Skip to content

Commit

Permalink
NBNP-448 Improve reporting in missing assets
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jun 19, 2024
1 parent cce67be commit 2cde36f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
}
Expand Down Expand Up @@ -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()),
];
}
Expand Down

0 comments on commit 2cde36f

Please sign in to comment.