Skip to content

Commit

Permalink
Fix identifier mask POST param for edit (#1653)
Browse files Browse the repository at this point in the history
Identifier mask should to be set for both create and edit actions since
an identifier might be generated during either of those actions.
  • Loading branch information
anvit committed Sep 14, 2023
1 parent c088704 commit e3e0ef7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit e3e0ef7

Please sign in to comment.