Browse Source

Something of namespacing the child-specific batch...

... 'cause need to slap together a media-specific batch similarly?
pull/896/head
Adam Vessey 3 years ago
parent
commit
65bccf019c
No known key found for this signature in database
GPG Key ID: 89B39535BF6D0D39
  1. 2
      islandora.services.yml
  2. 6
      src/Form/AddChildrenWizard/ChildBatchProcessor.php
  3. 4
      src/Form/AddChildrenWizard/FileSelectionForm.php

2
islandora.services.yml

@ -60,7 +60,7 @@ services:
tags: tags:
- { name: event_subscriber } - { name: event_subscriber }
islandora.upload_children.batch_processor: islandora.upload_children.batch_processor:
class: Drupal\islandora\Form\AddChildrenWizard\BatchProcessor class: Drupal\islandora\Form\AddChildrenWizard\ChildBatchProcessor
arguments: arguments:
- '@entity_type.manager' - '@entity_type.manager'
- '@database' - '@database'

6
src/Form/AddChildrenWizard/BatchProcessor.php → src/Form/AddChildrenWizard/ChildBatchProcessor.php

@ -14,7 +14,7 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
/** /**
* Children addition batch processor. * Children addition batch processor.
*/ */
class BatchProcessor { class ChildBatchProcessor {
use FieldTrait; use FieldTrait;
@ -171,8 +171,8 @@ class BatchProcessor {
foreach ($info as $id => $count) { foreach ($info as $id => $count) {
$this->messenger()->addWarning($this->formatPlural( $this->messenger()->addWarning($this->formatPlural(
$count, $count,
'1 validation error present in <a href=":uri">bulk created entity of type %type, with ID %id</a>.', '1 validation error present in <a target="_blank" href=":uri">bulk created entity of type %type, with ID %id</a>.',
'@count validation errors present in <a href=":uri">bulk created entity of type %type, with ID %id</a>.', '@count validation errors present in <a target="_blank" href=":uri">bulk created entity of type %type, with ID %id</a>.',
[ [
'%type' => $entity_type, '%type' => $entity_type,
':uri' => Url::fromRoute("entity.{$entity_type}.canonical", [$entity_type => $id])->toString(), ':uri' => Url::fromRoute("entity.{$entity_type}.canonical", [$entity_type => $id])->toString(),

4
src/Form/AddChildrenWizard/FileSelectionForm.php

@ -43,9 +43,9 @@ class FileSelectionForm extends FormBase {
/** /**
* The batch processor service. * The batch processor service.
* *
* @var \Drupal\islandora\Form\AddChildrenWizard\BatchProcessor|null * @var \Drupal\islandora\Form\AddChildrenWizard\ChildBatchProcessor|null
*/ */
protected ?BatchProcessor $batchProcessor; protected ?ChildBatchProcessor $batchProcessor;
/** /**
* {@inheritdoc} * {@inheritdoc}

Loading…
Cancel
Save