CRM_Event_Form_Task_Register - Fix error "getFieldValue failed" (tentative)
authorTim Otten <totten@civicrm.org>
Tue, 8 Dec 2020 05:27:13 +0000 (21:27 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 8 Dec 2020 05:40:02 +0000 (21:40 -0800)
commit2497350fbcc8f3a9073b5722835541eccaa83537
tree2e765d2e962451bec6242fc22c6392ea0fbe8efb
parentdf80fbabc873519be8b08d2d49a682826e671994
CRM_Event_Form_Task_Register - Fix error "getFieldValue failed" (tentative)

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.
CRM/Event/Form/Task/Register.php
CRM/Event/Page/Tab.php