Browse Source

Deal explicitly with URIs, instead of attempting to put the entity in config.

pull/1006/head
Adam Vessey 1 year ago
parent
commit
f896c4f535
No known key found for this signature in database
GPG Key ID: 89B39535BF6D0D39
  1. 2
      modules/islandora_iiif/config/schema/islandora_iiif.schema.yml
  2. 3
      modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php

2
modules/islandora_iiif/config/schema/islandora_iiif.schema.yml

@ -25,7 +25,7 @@ views.style.iiif_manifest:
label: "Structured OCR data file field"
sequence:
type: string
structured_text_term:
structured_text_term_uri:
type: string
label: "Structured text term"
search_endpoint:

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

@ -570,7 +570,7 @@ class IIIFManifest extends StylePluginBase {
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#title' => $this->t('Structured OCR text term'),
'#default_value' => $this->utils->getTermForUri($this->options['structured_text_term_uri']),
'#default_value' => $this->getStructuredTextTerm(),
'#required' => FALSE,
'#description' => $this->t('Term indicating the media that holds structured text, such as hOCR, for the given object. Use this if the text is on a separate media from the tile source.'),
];
@ -609,6 +609,7 @@ class IIIFManifest extends StylePluginBase {
// @codingStandardsIgnoreEnd
$style_options = $form_state->getValue('style_options');
$tid = $style_options['structured_text_term'];
unset($style_options['structured_text_term']);
$term = $this->entityTypeManager->getStorage('taxonomy_term')->load($tid);
$style_options['structured_text_term_uri'] = $this->utils->getUriForTerm($term);
$form_state->setValue('style_options', $style_options);

Loading…
Cancel
Save