We have a scenario where the checkbox is presented but is optional. This is then in 'params' which is passed through to
PropertyBag. The value is equal to '' so it fails to validate when we use it to set the value on the PropertyBag.
I don't think we lose anything meaningful by not setting an empty string and it avoids this error so we should
merge & release as a regression fix IMHO. If we want to revist then we should do that in master
https://lab.civicrm.org/dev/core/issues/1588
* @param int $contactID
*
* @return array
+ * @throws \CRM_Core_Exception
*/
protected function processFormSubmission($contactID) {
if (!isset($this->_params['payment_processor_id'])) {
* @param array $data
*/
public function mergeLegacyInputParams($data) {
- $this->legacyWarning("We have merged input params into the property bag for now but please rewrite code to not use this.");
+ $this->legacyWarning('We have merged input params into the property bag for now but please rewrite code to not use this.');
foreach ($data as $key => $value) {
- if ($value !== NULL) {
+ if ($value !== NULL && $value !== '') {
$this->offsetSet($key, $value);
}
}