Browse Source

Fix errors when OCR field not set.

pull/916/head
Rosie Le Faive 2 years ago
parent
commit
b47d37b1b6
  1. 6
      modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php

6
modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php

@ -205,11 +205,13 @@ class IIIFManifest extends StylePluginBase {
continue; continue;
} }
$ocrs = $entity->{$ocrField->definition['field_name']}; if (!is_null($ocrField)) {
$ocrs = $entity->{$ocrField->definition['field_name']};
$ocr = isset($ocrs[$i]) ? $ocrs[$i] : FALSE;
}
// Create the IIIF URL for this file // Create the IIIF URL for this file
// Visiting $iiif_url will resolve to the info.json for the image. // Visiting $iiif_url will resolve to the info.json for the image.
$ocr = isset($ocrs[$i]) ? $ocrs[$i] : FALSE;
$file_url = $image->entity->createFileUrl(FALSE); $file_url = $image->entity->createFileUrl(FALSE);
$mime_type = $image->entity->getMimeType(); $mime_type = $image->entity->getMimeType();
$iiif_url = rtrim($iiif_address, '/') . '/' . urlencode($file_url); $iiif_url = rtrim($iiif_address, '/') . '/' . urlencode($file_url);

Loading…
Cancel
Save