Skip to content

Commit

Permalink
Deal explicitly with URIs, instead of attempting to put the entity in…
Browse files Browse the repository at this point in the history
… config.
  • Loading branch information
adam-vessey committed Mar 20, 2024
1 parent 71a11ee commit f896c4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#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.'),
];
Expand Down Expand Up @@ -609,6 +609,7 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) {
// @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);
Expand Down

0 comments on commit f896c4f

Please sign in to comment.