-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#272 : Fatal Error (Regression) on PCP pages associated with Events #12532
Conversation
(Standard links)
|
CRM/Event/Form/Registration.php
Outdated
@@ -196,7 +196,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { | |||
*/ | |||
public function preProcess() { | |||
$this->_eventId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); | |||
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE); | |||
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like this should probably be changed to alphanumeric.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean:
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, CRM_Core_Action::ADD)
?
I did a grep on CRM codebase and all such occurrences I passing string value as default. Do
$ grep -irn --color "CRM_Utils_Request::retrieve('action'" CRM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mean $this->_action = CRM_Utils_Request::retrieve('action', 'Alphanumeric', $this, FALSE, 'add')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok. I think it would be best to have:
$this->_action = CRM_Utils_Request::retrieve('action', 'Alphanumeric', $this, FALSE, CRM_Core_Action::ADD);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep happy with that 👍 just figure Alphanumeric is bit more strict than string
Link to my GitLab reporting the issue: https://lab.civicrm.org/dev/core/issues/272 |
Thanks @monishdeb and @seamuslee001 - I will try/test that in production today once it passes tests |
@civicrm-builder re test this please |
5.4 version merged & there is a plan to do a 5.3.2 - merging |
Overview
There is regression found in Event's PCP as:
Regression is caused by https://github.com/civicrm/civicrm-core/pull/12056/files#diff-20d61aa96c8fdcd879d2b760f13ccc74R456
Before
Fatal error on Event's page
After
Fixed the error.
Technical Details
Here
addField('pcp_personel_note', ...)
expects$form->_action
which is not allotted toCRM/Event/Form/Registration/Register.php
. This patch assigned a default action to its parent class like we do for all other Civi forms. Alternatively we can provide the 'action' parameter i.e.But ideally we should always ensure that a form has action to render form elements for intended purpose.
Comments
ping @eileenmcnaughton @KarinG