From b077c342c04338555e728f9704e928401917d041 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 18 Oct 2023 16:13:46 -0400 Subject: [PATCH] dev/core#4707 Don't error if extension has empty `requires` tag --- CRM/Extension/Info.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Extension/Info.php b/CRM/Extension/Info.php index 2546da5c5c..9b1b5216ad 100644 --- a/CRM/Extension/Info.php +++ b/CRM/Extension/Info.php @@ -261,8 +261,8 @@ class CRM_Extension_Info { // and deeper into arrays. An exception for URLS section, since // we want them in special format. foreach ($info as $attr => $val) { - if (count($val->children()) == 0) { - $this->$attr = trim((string) $val); + if (!count($val->children())) { + $this->$attr = is_array($this->$attr) ? [] : trim((string) $val); } elseif ($attr === 'urls') { $this->urls = []; @@ -335,7 +335,7 @@ class CRM_Extension_Info { public function filterRequirements($requirements) { $filtered = []; $compatInfo = CRM_Extension_System::getCompatibilityInfo(); - foreach ($requirements->ext as $ext) { + foreach ($requirements->ext ?? [] as $ext) { $ext = (string) $ext; if (empty($compatInfo[$ext]['obsolete'])) { $filtered[] = $ext; -- 2.25.1