Skip to content

Commit

Permalink
Merge pull request #19969 from eileenmcnaughton/settingbag
Browse files Browse the repository at this point in the history
E-notice fix on serialized setting
  • Loading branch information
seamuslee001 authored Apr 7, 2021
2 parents 369ee4e + c11c73c commit 6b0cbfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Admin/Form/SettingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ protected function setDefaultsForMetadataDefinedFields() {
foreach (array_keys($this->_settings) as $setting) {
$this->_defaults[$setting] = civicrm_api3('setting', 'getvalue', ['name' => $setting]);
$spec = $this->getSettingsMetaData()[$setting];
if (!empty($spec['serialize'])) {
$this->_defaults[$setting] = CRM_Core_DAO::unSerializeField($this->_defaults[$setting], $spec['serialize']);
if (!empty($spec['serialize']) && !is_array($this->_defaults[$setting])) {
$this->_defaults[$setting] = CRM_Core_DAO::unSerializeField((string) $this->_defaults[$setting], $spec['serialize']);
}
if ($this->getQuickFormType($spec) === 'CheckBoxes') {
$this->_defaults[$setting] = array_fill_keys($this->_defaults[$setting], 1);
Expand Down

0 comments on commit 6b0cbfa

Please sign in to comment.