From ae12a465ee8621f009aabeb176f0e4747d0458fb Mon Sep 17 00:00:00 2001 From: Mathieu Lu Date: Fri, 30 Jun 2023 11:16:22 -0400 Subject: [PATCH] Note Form: use EntityFormTrait and setEntityId for postProcess hooks --- CRM/Note/Form/Note.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CRM/Note/Form/Note.php b/CRM/Note/Form/Note.php index 1bfed49b12..33addb0e37 100644 --- a/CRM/Note/Form/Note.php +++ b/CRM/Note/Form/Note.php @@ -25,6 +25,8 @@ */ class CRM_Note_Form_Note extends CRM_Core_Form { + use CRM_Core_Form_EntityFormTrait; + /** * The table name, used when editing/creating a note * @@ -39,13 +41,6 @@ class CRM_Note_Form_Note extends CRM_Core_Form { */ protected $_entityId; - /** - * The note id, used when editing the note - * - * @var int - */ - protected $_id; - /** * The parent note id, used when adding a comment to a note * @@ -193,6 +188,9 @@ class CRM_Note_Form_Note extends CRM_Core_Form { $ids = []; $note = CRM_Core_BAO_Note::add($params, $ids); + // Required for postProcess hooks + $this->setEntityId($note->id); + CRM_Core_Session::setStatus(ts('Your Note has been saved.'), ts('Saved'), 'success'); } -- 2.25.1