Commit a60bf6bf authored by Charlotte Bataille's avatar Charlotte Bataille
Browse files

feat/18079 : prevent the update for disabled org

parent 3b0bedf4
Pipeline #14340 failed with stages
in 58 seconds
......@@ -989,6 +989,12 @@ trait archiveModificationTrait
$currentOwnerOrgId = $archive->originatorOwnerOrgId;
$newOriginatorOrg = $this->sdoFactory->read('organization/organization', $orgId);
if ($newOriginatorOrg->enabled == false) {
throw new \bundle\recordsManagement\Exception\organizationException(
"This organization is disabled."
);
}
if ($currentOwnerOrgId == $newOriginatorOrg->ownerOrgId) {
$archive->originatorOrgRegNumber = $newOriginatorOrg->registrationNumber;
$archive->lastModificationDate = \laabs::newTimestamp();
......
......@@ -266,6 +266,9 @@ msgstr "Une archive n'ayant pas le statut 'Conservée' ne peut pas être modifi
msgid "The new originator organization of the archive must have the same owner organization as the current one."
msgstr "Le nouveau service producteur de l'archive doit avoir la même organisation racine que le service producteur actuel."
msgid "This organization is disabled."
msgstr "Ce service est inactif."
msgid "An action is already in progress on this archive."
msgstr "Une action est déjà en cours sur cette archive."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment