Skip to content

Commit

Permalink
Merge pull request #25230 from braders/php8-customdatabytype
Browse files Browse the repository at this point in the history
[REF] Fix strstr deprecation in CustomDataByType class
  • Loading branch information
eileenmcnaughton authored Dec 29, 2022
2 parents f2795c8 + ad3247e commit 1fd8984
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Custom/Form/CustomDataByType.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function preProcess() {
if (array_key_exists($this->_type, $contactTypes)) {
$this->assign('contactId', $this->_entityId);
}
if (!is_array($this->_subType) && strstr($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR)) {
if (!is_array($this->_subType) && strstr($this->_subType ?? '', CRM_Core_DAO::VALUE_SEPARATOR)) {
CRM_Core_Error::deprecatedWarning('Using a CRM_Core_DAO::VALUE_SEPARATOR separated subType on civicrm/custom route is deprecated, use a comma-separated string instead.');
$this->_subType = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR));
}
CRM_Custom_Form_CustomData::setGroupTree($this, $this->_subType, $this->_groupID, $this->_onlySubtype);
Expand Down

0 comments on commit 1fd8984

Please sign in to comment.