Event Registration Task - Propagate different qfKey & action for AJAX URLs
authorTim Otten <totten@civicrm.org>
Sat, 5 Dec 2020 07:29:28 +0000 (23:29 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 5 Dec 2020 07:29:28 +0000 (23:29 -0800)
When use the search-task to register event participants, the qfKey is
mismatched, and the action is VIEW. It should be ADD, and the qfKey
should be for CRM_Event_Form_Participant.

CRM/Event/Form/Task/Register.php
CRM/Event/Page/Tab.php
templates/CRM/Event/Form/Task/Register.tpl

index e9ca978c2f69994632aabcf141f247456ea0abf1..5d1082c857fa2bc33bce39ac36eb83d8633f691d 100644 (file)
@@ -72,7 +72,11 @@ class CRM_Event_Form_Task_Register extends CRM_Event_Form_Participant {
 
     //set ajax path, this used for custom data building
     $this->assign('urlPath', 'civicrm/contact/view/participant');
-    $this->assign('urlPathVar', "_qf_Participant_display=true&qfKey={$this->controller->_key}");
+
+    $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");
   }
 
 }
index 2c75b80d2d74f4c8f9c37ca36915950a49d8a96e..0d039cdc1e3b40fb3a5db99f33760ec54290a287 100644 (file)
@@ -90,7 +90,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
     $controller = new CRM_Core_Controller_Simple(
       'CRM_Event_Form_Participant',
       'Create Participation',
-      $this->_action, FALSE, FALSE, TRUE
+      $this->_action
     );
 
     $controller->setEmbedded(TRUE);
index 6fa18c56bffb37d8d89e6934d51a3780d11dce72..2f1ea14ca4fb6a51fb8b978d5fcc402e94e18070 100644 (file)
@@ -7,4 +7,6 @@
  | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
 *}
-{include file="CRM/Event/Form/Participant.tpl"}
+{crmScope qfKey=$participantQfKey action=$participantAction}
+  {include file="CRM/Event/Form/Participant.tpl"}
+{/crmScope}