From 62274a25daea5a04e6a348fd438008c3c78846e9 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 14 Apr 2022 12:56:49 -0700 Subject: [PATCH] "Manage Extensions" - Fix title display 1. Extensions sometimes display the `key` rather than the ``. This happens because it only reads titles from the remote/download feed. 2. When the key is used, put some styling on it. 3. Escape from Los Smartalous --- CRM/Admin/Form/Extensions.php | 5 ++++- templates/CRM/Admin/Form/Extensions.tpl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index 83fba1bdcb..936f5a6f72 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -49,7 +49,10 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form { if (!CRM_Utils_Type::validate($this->_key, 'ExtensionKey') && !empty($this->_key)) { throw new CRM_Core_Exception('Extension Key does not match expected standard'); } - $this->label = $remoteExtensionRows[$this->_key]['label'] ?? $this->_key; + + $name = $remoteExtensionRows[$this->_key]['label'] ?? $localExtensionRows[$this->_key]['label'] ?? NULL; + $this->label = $name ? sprintf('%s (%s)', htmlentities($name), htmlentities($this->_key)) + : sprintf('%s', htmlentities($this->_key)); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1&action=browse'); $session->pushUserContext($url); diff --git a/templates/CRM/Admin/Form/Extensions.tpl b/templates/CRM/Admin/Form/Extensions.tpl index d8c1b95b9e..edbee349c0 100644 --- a/templates/CRM/Admin/Form/Extensions.tpl +++ b/templates/CRM/Admin/Form/Extensions.tpl @@ -8,7 +8,7 @@ +--------------------------------------------------------------------+ *} {* this template is used for install /uninstall extensions *} -

{$title}

+

{$title|smarty:nodefaults}

{if $action eq 8}
-- 2.25.1