Skip to content

Commit

Permalink
Call publication edit hook when chapter and representation is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagolepidus committed Sep 3, 2024
1 parent c278e4b commit a45c2fa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ function deleteFormat($args, $request) {
$notificationMgr = new NotificationManager();
$notificationMgr->createTrivialNotification($currentUser->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.removedPublicationFormat')));

$publication = Services::get('publication')->edit($publication, [], $request);

return DAO::getDataChangedEvent();
}

Expand Down Expand Up @@ -383,6 +385,8 @@ function setApproved($args, $request) {
$publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($representation, $request->getContext());
}

$publication = Services::get('publication')->edit($publication, [], $request);

return DAO::getDataChangedEvent($representation->getId());
}

Expand Down Expand Up @@ -425,6 +429,8 @@ function setAvailable($args, $request) {
$publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($publicationFormat, $context);
}

$publication = Services::get('publication')->edit($publication, [], $request);

return DAO::getDataChangedEvent($publicationFormat->getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ function execute(...$functionParams) {
SubmissionLog::logEvent(Application::get()->getRequest(), $this->getMonograph(), SUBMISSION_LOG_PUBLICATION_FORMAT_CREATE, 'submission.event.publicationFormatCreated', array('formatName' => $publicationFormat->getLocalizedName()));
}

$publication = Services::get('publication')->edit($publication, [], Application::get()->getRequest());

return $representationId;
}
}


4 changes: 2 additions & 2 deletions controllers/grid/users/chapter/ChapterGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ function deleteChapter($args, $request) {

$chapterDao = DAORegistry::getDAO('ChapterDAO'); /* @var $chapterDao ChapterDAO */
$chapterDao->deleteById($chapterId);
$publication = $this->getPublication();
$publication = Services::get('publication')->edit($publication, [], $request);
return DAO::getDataChangedEvent();
}

Expand All @@ -495,5 +497,3 @@ function _getChapterFromRequest($request) {
);
}
}


4 changes: 2 additions & 2 deletions controllers/grid/users/chapter/form/ChapterForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ function execute(...$functionParams) {
DAORegistry::getDAO('SubmissionFileDAO')->updateChapterFiles($selectedFiles, $this->getChapter()->getId());
}

$publication = Services::get('publication')->edit($publication, [], Application::get()->getRequest());

return true;
}
}


0 comments on commit a45c2fa

Please sign in to comment.