Commit dddbf637 authored by Alexandre Morin's avatar Alexandre Morin

Merge branch 'hotfix/2.3.10' into 'Support/2.3.X'

Fix check integrity journal

See merge request !232
parents 4e1fe778 36890392
......@@ -763,6 +763,7 @@ class journal
{
$logController = \laabs::newController('recordsManagement/log');
$archiveController = \laabs::newController('recordsManagement/archive');
$digitalResourceController = \laabs::newController('digitalResource/digitalResource');
// Read journal
if (is_scalar($archiveId) || get_class($archiveId) == 'core\Type\Id') {
......@@ -772,7 +773,7 @@ class journal
$archiveId = (string) $journal->archiveId;
}
$resources = $archiveController->getDigitalResources($journal->archiveId);
$journalResource = $resources[0];
$journalResource = $digitalResourceController->retrieve($resources[0]->resId);
$resIntegrity = $archiveController->verifyIntegrity($journal->archiveId);
if (is_array($resIntegrity["error"]) && !empty($resIntegrity["error"])) {
......@@ -795,11 +796,12 @@ class journal
return true;
}
$resources = $archiveController->getDigitalResources($journalResource->archiveId);
$nextJournalResource = $resources[0];
$resources = $archiveController->getDigitalResources($nextJournal->archiveId);
$nextJournalResource = $digitalResourceController->retrieve($resources[0]->resId);
$nextJournalContents = $nextJournalResource->getContents();
$chainEvent = explode(',', strtok($nextJournalContents, "\n"));
$chainEvent = str_getcsv(strtok($nextJournalContents, "\n"));
// For older version compatibility
if (count($chainEvent) < 7) {
......
Markdown is supported
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