Browse Source

Allow application/xml in OCR Action.

ocr_mime
Rosie Le Faive 6 months ago
parent
commit
5e958a5e10
  1. 5
      modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivative.php

5
modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivative.php

@ -48,8 +48,9 @@ class GenerateOCRDerivative extends AbstractGenerateDerivative {
*/ */
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::validateConfigurationForm($form, $form_state); parent::validateConfigurationForm($form, $form_state);
$exploded_mime = explode('/', $form_state->getValue('mimetype')); $mime = $form_state->getValue('mimetype');
if ($exploded_mime[0] != 'text') { $exploded_mime = explode('/', $mime);
if ($exploded_mime[0] != 'text' && $mime != 'application/xml') {
$form_state->setErrorByName( $form_state->setErrorByName(
'mimetype', 'mimetype',
$this->t('Please enter file mimetype (e.g. text/plain.)') $this->t('Please enter file mimetype (e.g. text/plain.)')

Loading…
Cancel
Save