From e3e0ef77b8d9e43d596bbce1ab797407951a24ed Mon Sep 17 00:00:00 2001 From: Anvit Srivastav Date: Thu, 14 Sep 2023 11:39:02 -0700 Subject: [PATCH] Fix identifier mask POST param for edit (#1653) Identifier mask should to be set for both create and edit actions since an identifier might be generated during either of those actions. --- .../modules/informationobject/actions/editAction.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/qubit/modules/informationobject/actions/editAction.class.php b/apps/qubit/modules/informationobject/actions/editAction.class.php index 53197bd488..09ad4759fb 100644 --- a/apps/qubit/modules/informationobject/actions/editAction.class.php +++ b/apps/qubit/modules/informationobject/actions/editAction.class.php @@ -59,6 +59,9 @@ protected function earlyExecute() $this->publicationStatusId = QubitTerm::PUBLICATION_STATUS_DRAFT_ID; $this->unpublishing = false; + // To track if identifier mask is enabled + $this->mask = sfConfig::get('app_identifier_mask_enabled', 0); + // Edit if (isset($this->getRoute()->resource)) { $this->resource = $this->getRoute()->resource; @@ -713,7 +716,7 @@ private function handleIdentifierFromMask() { // Pass if we're using mask or not to template, fill in identifier with generated // identifier if so. - if ($this->mask = sfConfig::get('app_identifier_mask_enabled', 0)) { + if ($this->mask) { $this->resource->identifier = QubitInformationObject::generateIdentiferFromMask(); } }