From c77556b909e48887fd4ce77d83442a1a606504d4 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 11 Sep 2023 17:09:17 -0700 Subject: [PATCH] Generate `$label`s for modules in `DrupalBase` (D7/Backdrop) --- CRM/Utils/System/DrupalBase.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index c413c14ed0..f32c33a009 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -301,9 +301,11 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { */ public function getModules() { $result = []; - $q = db_query('SELECT name, status FROM {system} WHERE type = \'module\' AND schema_version <> -1'); + $q = db_query('SELECT name, status, info FROM {system} WHERE type = \'module\' AND schema_version <> -1'); foreach ($q as $row) { - $result[] = new CRM_Core_Module('drupal.' . $row->name, $row->status == 1); + $info = $row->info ? \CRM_Utils_String::unserialize($row->info) : []; + $label = _ts('%1 (%2)', [1 => $info['name'] ?? $row->name, 2 => _ts(CIVICRM_UF)]); + $result[] = new CRM_Core_Module('drupal.' . $row->name, $row->status == 1, $label); } return $result; } -- 2.25.1