Browse Source

Fix errors when OCR field not set.

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

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

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

Loading…
Cancel
Save