Fix ID retrieval for MailingComponent edit page
author19ATF72 <micah.hobby@gmail.com>
Tue, 5 Dec 2023 22:38:07 +0000 (14:38 -0800)
committer19ATF72 <micah.hobby@gmail.com>
Tue, 5 Dec 2023 22:40:32 +0000 (14:40 -0800)
CRM/Mailing/DAO/MailingComponent.php
CRM/Mailing/Form/Component.php
CRM/Mailing/xml/Menu/Mailing.xml
xml/schema/Mailing/MailingComponent.xml

index 1a0b2001d18bc1afd45c1d3c0c0b7c4d8d67915a..5c2177743148d9f8a5133b05e788864fba692ccb 100644 (file)
@@ -37,8 +37,9 @@ class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
    * @var string[]
    */
   protected static $_paths = [
-    'add' => 'civicrm/admin/component?action=add&reset=1',
-    'update' => 'civicrm/admin/component?action=update&id=[id]&reset=1',
+    'add' => 'civicrm/admin/component/edit?action=add&reset=1',
+    'update' => 'civicrm/admin/component/edit?action=update&id=[id]&reset=1',
+    'browse' => 'civicrm/admin/component?action=browse&id=[id]&reset=1',
   ];
 
   /**
index 660d0a8e1b77428c4a00135a0f4cf58f8cc5b613..603317c7b58da197cd0a7d6d598c7b49e64d2d24 100644 (file)
@@ -35,8 +35,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
   protected $_BAOName;
 
   public function preProcess() {
-    $this->_id = $this->get('id');
-    $this->_BAOName = $this->get('BAOName');
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
   }
 
   /**
@@ -94,8 +93,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
 
     if (isset($this->_id)) {
       $params = ['id' => $this->_id];
-      $baoName = $this->_BAOName;
-      $baoName::retrieve($params, $defaults);
+      CRM_Mailing_BAO_MailingComponent::retrieve($params, $defaults);
     }
     else {
       $defaults['is_active'] = 1;
index 3067227861a18e9424177484b0a1f6e89d4d13ea..f3267235d3b0e63651ed96864091c427d07cb84f 100644 (file)
     <adminGroup>CiviMail</adminGroup>
     <weight>410</weight>
   </item>
+  <item>
+    <path>civicrm/admin/component/edit</path>
+    <title>Headers, Footers, and Automated Messages</title>
+    <page_callback>CRM_Mailing_Form_Component</page_callback>
+    <desc>Configure the header and footer used for mailings. Customize the content of automated Subscribe, Unsubscribe, Resubscribe and Opt-out messages.</desc>
+    <access_arguments>access CiviCRM,access CiviMail</access_arguments>
+    <adminGroup>CiviMail</adminGroup>
+    <weight>411</weight>
+  </item>
   <item>
     <path>civicrm/admin/options/from_email_address/civimail</path>
     <title>From Email Addresses</title>
index 7ef2d0e0c8ec763db1668ec6a5e58e826432b43c..a35b61d07ca6fb17acf4cbfc457a132299474a30 100644 (file)
@@ -7,8 +7,9 @@
   <comment>Stores information about the mailing components (header/footer).</comment>
   <component>CiviMail</component>
   <paths>
-    <add>civicrm/admin/component?action=add&amp;reset=1</add>
-    <update>civicrm/admin/component?action=update&amp;id=[id]&amp;reset=1</update>
+    <add>civicrm/admin/component/edit?action=add&amp;reset=1</add>
+    <update>civicrm/admin/component/edit?action=update&amp;id=[id]&amp;reset=1</update>
+    <browse>civicrm/admin/component?action=browse&amp;id=[id]&amp;reset=1</browse>
   </paths>
   <field>
     <name>id</name>