Merge pull request #21585 from eileenmcnaughton/compat
[civicrm-core.git] / CRM / Extension / Manager / Report.php
index bd8b5d67a7477e42bd72a32bba535506aa84af01..da14a38b2129b8ec916f779442cd9a5861a3a7e5 100644 (file)
@@ -24,7 +24,10 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
    */
   public function __construct() {
     parent::__construct(TRUE);
-    $this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
+  }
+
+  public function getGroupId() {
+    return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
       self::REPORT_GROUP_NAME, 'id', 'name'
     );
   }
@@ -51,7 +54,7 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
       throw new CRM_Core_Exception(ts('Component for which you are trying to install the extension (%1) is currently disabled.', [1 => $info->typeInfo['component']]));
     }
     $weight = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue',
-      ['option_group_id' => $this->groupId]
+      ['option_group_id' => $this->getGroupId()]
     );
     $params = [
       'label' => $info->label . ' (' . $info->key . ')',
@@ -60,7 +63,7 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
       'weight' => $weight,
       'description' => $info->label . ' (' . $info->key . ')',
       'component_id' => $compId,
-      'option_group_id' => $this->groupId,
+      'option_group_id' => $this->getGroupId(),
       'is_active' => 1,
     ];