Details
Description
strange behavior when saving an event. reproducible on both demo and sandbox.
1) edit an existing event by entering the PCP page
2) turn PCP on, select a profile, and save
3) turn PCP off and save
>> a different event loads and the PCP was not disabled for the original event.
found the issue:
CRM_Event_Form_ManageEvent::preProcess()
around line 108 we have:
if (empty($this->_addProfileBottom) && empty($this->_addProfileBottomAdd)) {
$this->add('hidden', 'id', $this->_id);
}
at some point, the _id shifts from the event ID to the PCP ID and is set to the form as a hidden value. when the preProcess is called a second time on form submit, this value is retrieved instead of the main ID for the event (I believe from $_GET).
I'm not sure why we are setting that value for the profiles, but if we exclude the PCP page from that var set, it fixes it.