diff --git a/src/Plugin/QueueWorker/AbstractPostProcessorQueueWorker.php b/src/Plugin/QueueWorker/AbstractPostProcessorQueueWorker.php index 3b5b89b..a149081 100644 --- a/src/Plugin/QueueWorker/AbstractPostProcessorQueueWorker.php +++ b/src/Plugin/QueueWorker/AbstractPostProcessorQueueWorker.php @@ -86,8 +86,13 @@ abstract class AbstractPostProcessorQueueWorker extends QueueWorkerBase implemen * @param array $configuration * @param string $plugin_id * @param mixed $plugin_definition - * @param \Drupal\Core\Entity\EntityTypeManager $entity_field_manager + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * @param \Drupal\strawberry_runners\Plugin\StrawberryRunnersPostProcessorPluginManager $strawberry_runner_processor_plugin_manager + * @param \Drupal\Core\File\FileSystemInterface $file_system + * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager + * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value + * @param \Psr\Log\LoggerInterface $logger + * @param \Drupal\search_api\ParseMode\ParseModePluginManager $parse_mode_manager */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, StrawberryRunnersPostProcessorPluginManager $strawberry_runner_processor_plugin_manager, FileSystemInterface $file_system, StreamWrapperManagerInterface $stream_wrapper_manager, KeyValueFactoryInterface $key_value, LoggerInterface $logger, ParseModePluginManager $parse_mode_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); diff --git a/src/Plugin/StrawberryRunnersPostProcessor/OcrPostProcessor.php b/src/Plugin/StrawberryRunnersPostProcessor/OcrPostProcessor.php index b46f03d..20ad58e 100644 --- a/src/Plugin/StrawberryRunnersPostProcessor/OcrPostProcessor.php +++ b/src/Plugin/StrawberryRunnersPostProcessor/OcrPostProcessor.php @@ -341,7 +341,7 @@ protected function hOCRtoMiniOCR($output, $pageid) { // NOTE: floats are in the form of .1 so we need to remove the first 0. if (count($coos)) { $miniocr->startElement("p"); - $miniocr->writeAttribute("xml:id", $pageid); + $miniocr->writeAttribute("xml:id", 'sequence_'.$pageid); $miniocr->writeAttribute("wh", ltrim($pwidth, 0) . " " . ltrim($pheight, 0)); $miniocr->startElement("b"); $page->registerXPathNamespace('ns', 'http://www.w3.org/1999/xhtml'); diff --git a/strawberry_runners.install b/strawberry_runners.install index 2dd7421..de03244 100644 --- a/strawberry_runners.install +++ b/strawberry_runners.install @@ -8,7 +8,7 @@ use Drupal\Core\StringTranslation\TranslatableMarkup; * * @see 'https://www.drupal.org/node/3034742' */ -function strawberry_runners_update_8100() { +function strawberry_runners_update_8001() { \Drupal::entityDefinitionUpdateManager()->installEntityType(new ConfigEntityType([ 'id' => 'strawberry_runners_postprocessor', 'label' => new TranslatableMarkup('Strawberry Runners Post Processor Configuration'), @@ -34,3 +34,17 @@ function strawberry_runners_update_8100() { ], ])); } +/** + * Update 8002 - Create AMI Set entity. + */ +function strawberry_runners_update_8002() { + + if(!db_table_exists('runneritem_entity')) { + \Drupal::entityTypeManager()->clearCachedDefinitions(); + \Drupal::entityDefinitionUpdateManager() + ->installEntityType(\Drupal::entityTypeManager()->getDefinition('runneritem_entity')); + } + else { + return 'runner item entity already exists'; + } +}