From 625beba6cb17081f4f8ca0030e4ca4921a988a14 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 20 Oct 2020 10:00:31 +0200 Subject: [PATCH 1/4] Set id after save for the mailing component in the postProcess --- CRM/Mailing/Form/Component.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index dacb27d55c6e..1580448b444a 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -116,6 +116,9 @@ public function postProcess() { } $component = CRM_Mailing_BAO_MailingComponent::add($params); + + $this->_id = $component->id; + CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', [ 1 => $component->name, ]), ts('Saved'), 'success'); From 1e52e658986760e5eecde250ae597c15228e9f46 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 22 Oct 2020 12:19:38 +0200 Subject: [PATCH 2/4] Added comment and removed whitespace --- CRM/Mailing/Form/Component.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 1580448b444a..9f6ad5be4bb8 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -116,11 +116,13 @@ public function postProcess() { } $component = CRM_Mailing_BAO_MailingComponent::add($params); - + + // set the id after save, so it can be used in a extension using the postProcess hook $this->_id = $component->id; - + CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', [ 1 => $component->name, + ]), ts('Saved'), 'success'); } From c3695bd42baecc7fe0191e3bafef17a7db1d30be Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 23 Oct 2020 08:56:59 +0200 Subject: [PATCH 3/4] Removed empty line. --- CRM/Mailing/Form/Component.php | 1 - 1 file changed, 1 deletion(-) diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 9f6ad5be4bb8..6044fd565888 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -122,7 +122,6 @@ public function postProcess() { CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', [ 1 => $component->name, - ]), ts('Saved'), 'success'); } From 4789e57032da9de9e8b46611052fc4b8406d38ef Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 26 Oct 2020 09:37:24 +0100 Subject: [PATCH 4/4] Removed empty line. --- CRM/Mailing/Form/Component.php | 1 - 1 file changed, 1 deletion(-) diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 6044fd565888..ceb8795eeb98 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -123,7 +123,6 @@ public function postProcess() { CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', [ 1 => $component->name, ]), ts('Saved'), 'success'); - } /**