Skip to content

EspoCRM – Open Source CRM Application

Fix note pin

Yuriie31024e72843
diff --git a/application/Espo/Tools/Stream/Api/PostNotePin.php b/application/Espo/Tools/Stream/Api/PostNotePin.php
index 8044506c5f..a17fb1cc00 100644
--- a/application/Espo/Tools/Stream/Api/PostNotePin.php
+++ b/application/Espo/Tools/Stream/Api/PostNotePin.php
@@ -72,6 +72,9 @@ class PostNotePin implements Action
$this->checkParent($note);
$this->checkPinnedCount($note);
+ $note->setIsPinned(true);
+ $this->entityManager->saveEntity($note);
+
return ResponseComposer::json(true);
}
@@ -91,9 +94,6 @@ class PostNotePin implements Action
throw new Forbidden("No read access.");
}
- $note->setIsPinned(true);
- $this->entityManager->saveEntity($note);
-
return $note;
}