Skip to content

Commit

Permalink
Call form execute hook after object update
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagolepidus committed Sep 4, 2024
1 parent c278e4b commit 997c7f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public function readInputData() {
* @copydoc Form::execute()
*/
public function execute(...$functionArgs) {
parent::execute(...$functionArgs);
$identificationCodeDao = DAORegistry::getDAO('IdentificationCodeDAO'); /* @var $identificationCodeDao IdentificationCodeDAO */
$publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); /* @var $publicationFormatDao PublicationFormatDAO */

Expand Down Expand Up @@ -209,6 +208,9 @@ public function execute(...$functionArgs) {
$identificationCodeId = $identificationCodeDao->insertObject($identificationCode);
}

// in order to be able to use the hook
parent::execute(...$functionArgs);

return $identificationCodeId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ function readInputData() {
* @see Form::execute()
*/
function execute(...$functionParams) {
parent::execute(...$functionParams);

$publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); /* @var $publicationFormatDao PublicationFormatDAO */
$publicationFormat = $this->getPublicationFormat();
if (!$publicationFormat) {
Expand Down Expand Up @@ -188,6 +186,9 @@ function execute(...$functionParams) {
SubmissionLog::logEvent(Application::get()->getRequest(), $this->getMonograph(), SUBMISSION_LOG_PUBLICATION_FORMAT_CREATE, 'submission.event.publicationFormatCreated', array('formatName' => $publicationFormat->getLocalizedName()));
}

// in order to be able to use the hook
parent::execute(...$functionParams);

return $representationId;
}
}
Expand Down
5 changes: 3 additions & 2 deletions controllers/grid/users/chapter/form/ChapterForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ function readInputData() {
* @see Form::execute()
*/
function execute(...$functionParams) {
parent::execute(...$functionParams);

$chapterDao = DAORegistry::getDAO('ChapterDAO'); /* @var $chapterDao ChapterDAO */
$chapter = $this->getChapter();
$isEdit = !!$chapter;
Expand Down Expand Up @@ -238,6 +236,9 @@ function execute(...$functionParams) {
DAORegistry::getDAO('SubmissionFileDAO')->updateChapterFiles($selectedFiles, $this->getChapter()->getId());
}

// in order to be able to use the hook
parent::execute(...$functionParams);

return true;
}
}
Expand Down

0 comments on commit 997c7f3

Please sign in to comment.