From 2cde36f69547cd3642f0bf5273381db0c15dfda7 Mon Sep 17 00:00:00 2001 From: Jacob Sanford Date: Wed, 19 Jun 2024 10:30:26 -0300 Subject: [PATCH] NBNP-448 Improve reporting in missing assets --- .../digital_serial_issue/src/DataIntegrityOfficer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom/modules/digital_serial/modules/digital_serial_issue/src/DataIntegrityOfficer.php b/custom/modules/digital_serial/modules/digital_serial_issue/src/DataIntegrityOfficer.php index 417e983a..3928c878 100644 --- a/custom/modules/digital_serial/modules/digital_serial_issue/src/DataIntegrityOfficer.php +++ b/custom/modules/digital_serial/modules/digital_serial_issue/src/DataIntegrityOfficer.php @@ -297,17 +297,18 @@ public static function reportPagesWithMissingFiles() // Case 2&3: FID referenced but no file, or file zero length. foreach ($pages as $page) { $file_path = $page['uri']; - $fid = $page['id']; if (!file_exists($file_path)) { $items[] = [ 'page_id' => $page['id'], - 'fid' => $fid, + 'fid' => $page['fid'], + 'path' => $file_path, 'details' => 'File DNE', ]; } elseif (filesize($file_path) == 0) { $items[] = [ 'page_id' => $page['id'], - 'fid' => $fid, + 'fid' => $page['fid'], + 'path' => $file_path, 'details' => 'File 0length', ]; } @@ -355,6 +356,7 @@ public static function getAbsoluteFilePaths() ->load($id); $pages[] = [ 'id' => $page_entity->id(), + 'fid' => $page_entity->getPageImage()->target_id, 'path' => $file_system->realpath($page_entity->getPageImage()->getFileUri()), ]; }