diff --git a/src/app/resource/controllers/StoreController.php b/src/app/resource/controllers/StoreController.php index a95aa3c6b4ae596c8da57600751663627511a697..05825434d66e47efd9037b882f4523ebc7680d48 100755 --- a/src/app/resource/controllers/StoreController.php +++ b/src/app/resource/controllers/StoreController.php @@ -121,10 +121,6 @@ class StoreController $args['typist'] = $GLOBALS['id']; } - $chrono = null; - if (!empty($args['chrono'])) { - $chrono = ChronoModel::getChrono(['id' => $indexingModel['category'], 'entityId' => $args['destination'], 'typeId' => $args['doctype'], 'resId' => $args['resId']]); - } if (!empty($args['initiator'])) { $entity = EntityModel::getById(['id' => $args['initiator'], 'select' => ['entity_id']]); @@ -134,6 +130,10 @@ class StoreController $entity = EntityModel::getById(['id' => $args['destination'], 'select' => ['entity_id']]); $args['destination'] = $entity['entity_id']; } + $chrono = null; + if (!empty($args['chrono'])) { + $chrono = ChronoModel::getChrono(['id' => $indexingModel['category'], 'entityId' => $args['destination'], 'typeId' => $args['doctype'], 'resId' => $args['resId']]); + } if (!empty($args['processLimitDate']) && !empty($args['priority'])) { $args['priority'] = IndexingController::calculatePriorityWithProcessLimitDate(['processLimitDate' => $args['processLimitDate']]);