When preparing the event-registration form, `CRM_Event_Page_Tab::preProcess()` looks up the designated contact ID and
calls `checkUserPermission()`. The error message is (effectively) reporting that the permission-check fails because
there is no contact ID.
And this is a legit thing to complain about -- if you're embedding the event-registration form as part of a
search-task, then there is no *singular* contact ID. (There is a potentially very long list of contact IDs - which is
probably stored/reported some other way.) The permission-check for this context seems like it ought to be different.
I labeled the commit (tentative) because I'm not entirely certain that I understand the contract of this
route/controller. It has multiple overlapping use-cases, and I'm not certain if I've tracked them all. However, this
patch does seem to fix the "getFieldValue failed" problem when running as a search-task.
$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");
+ $this->assign('urlPathVar', "_qf_Participant_display=true&context=search");
}
}
$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 {