Skip to content

Commit

Permalink
Merge pull request #26686 from mlutfy/noteEntityId
Browse files Browse the repository at this point in the history
Note Form: use EntityFormTrait and setEntityId for postProcess hooks
  • Loading branch information
eileenmcnaughton authored Jun 30, 2023
2 parents e856dd3 + ae12a46 commit 36009a2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions CRM/Note/Form/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
*
Expand Down Expand Up @@ -193,6 +188,9 @@ public function postProcess() {
$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');
}

Expand Down

0 comments on commit 36009a2

Please sign in to comment.