Skip to content

Commit

Permalink
Add update of Publication object when switching locales, issue: pkp/p…
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-stefan-weiher committed Mar 12, 2021
1 parent f63624b commit 99ca8ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions QuickSubmitForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ function __construct($plugin, $request) {

if ($submissionId = $request->getUserVar('submissionId')) {
$submissionDao = Application::getSubmissionDAO();
$publicationDao = DAORegistry::getDAO('PublicationDAO'); /* @var $publicationDao PublicationDAO */
$this->_submission = $submissionDao->getById($submissionId);
if ($this->_submission->getContextId() != $this->_context->getId()) throw new Exeption('Submission not in context!');
$this->_submission->setLocale($this->getDefaultFormLocale());
$publication = $this->_submission->getCurrentPublication();
$publication->setData('locale', $this->getDefaultFormLocale());
$publication->setData('language', PKPString::substr($this->getDefaultFormLocale(), 0, 2));
$submissionDao->updateObject($this->_submission);
$publicationDao->updateObject($publication);

$this->_metadataFormImplem->addChecks($this->_submission);
}
Expand Down

0 comments on commit 99ca8ef

Please sign in to comment.