From e72fbbe1d94791ef6f8e0793cd4cfb9c0d04acd5 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Thu, 8 Aug 2024 06:45:49 +1200 Subject: [PATCH] Islandora/islandora#2338: Handle unset structured_text_term_uri option --- .../islandora_iiif/src/Plugin/views/style/IIIFManifest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php index 6afae2499..c1bb234ea 100644 --- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php +++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php @@ -709,9 +709,10 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { * The term if it could be found; otherwise, NULL. */ protected function getStructuredTextTerm() : ?TermInterface { - if (!$this->structuredTextTermMemoized) { - $this->structuredTextTermMemoized = TRUE; - $this->structuredTextTerm = $this->utils->getTermForUri($this->options['structured_text_term_uri']); + if (!$this->structuredTextTermMemoized && !empty($this->options['structured_text_term_uri'])) { + if ($this->structuredTextTerm = $this->utils->getTermForUri($this->options['structured_text_term_uri'])) { + $this->structuredTextTermMemoized = TRUE; + } } return $this->structuredTextTerm;