Skip to content

Commit

Permalink
Merge pull request #19127 from eileenmcnaughton/532p
Browse files Browse the repository at this point in the history
CiviEvent - Error registering through advanced search task
  • Loading branch information
totten authored Dec 9, 2020
2 parents c14c1c5 + 21aab5a commit 141f95a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ public function preProcess() {

// when fee amount is included in form
if (!empty($_POST['hidden_feeblock']) || !empty($_POST['send_receipt'])) {
if ($this->_submitValues['event_id']) {
$this->_eventId = $this->_submitValues['event_id'];
}
CRM_Event_Form_EventFees::preProcess($this);
$this->buildEventFeeForm($this);
CRM_Event_Form_EventFees::setDefaultValues($this);
Expand Down
8 changes: 6 additions & 2 deletions CRM/Event/Form/Task/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ protected function assignUrlPath() {
$this->_contactId = NULL;

//set ajax path, this used for custom data building
$this->assign('urlPath', $urlString);
$this->assign('urlPathVar', "_qf_Participant_display=true&qfKey={$this->controller->_key}");
$this->assign('urlPath', 'civicrm/contact/view/participant');

$key = CRM_Core_Key::get('CRM_Event_Form_Participant', TRUE);
$this->assign('participantQfKey', $key);
$this->assign('participantAction', CRM_Core_Action::ADD);
$this->assign('urlPathVar', "_qf_Participant_display=true&context=search");
}

}
4 changes: 2 additions & 2 deletions CRM/Event/Page/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public function preProcess() {
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);

if ($context == 'standalone') {
if ($context == 'standalone' || $context === 'search') {
$this->_action = CRM_Core_Action::ADD;
}
else {
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$this->assign('contactId', $this->_contactId);

// check logged in url permission
Expand Down
12 changes: 12 additions & 0 deletions templates/CRM/Event/Form/Task/Register.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{crmScope qfKey=$participantQfKey action=$participantAction}
{include file="CRM/Event/Form/Participant.tpl"}
{/crmScope}

0 comments on commit 141f95a

Please sign in to comment.