From e9f9aad49c78c92c11e46b93289b7c3b44cb6069 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 29 Apr 2022 19:08:15 +0000 Subject: [PATCH 01/13] Set IIIF Manifest title based on content title. --- .../src/Plugin/views/style/IIIFManifest.php | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php index 073ca04e..779451c2 100644 --- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php +++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php @@ -121,18 +121,22 @@ class IIIFManifest extends StylePluginBase { $iiif_address = $this->iiifConfig->get('iiif_server'); if (!is_null($iiif_address) && !empty($iiif_address)) { // Get the current URL being requested. - $request_url = $this->request->getSchemeAndHttpHost() . $this->request->getRequestUri(); + $request_host = $this->request->getSchemeAndHttpHost(); + $request_url = $this->request->getRequestUri(); // Strip off the last URI component to get the base ID of the URL. // @todo assumming the view is a path like /node/1/manifest.json $url_components = explode('/', $request_url); array_pop($url_components); - $iiif_base_id = implode('/', $url_components); + $content_path = implode('/', $url_components); + $iiif_base_id = $request_host . '/' . $content_path; + + // @see https://iiif.io/api/presentation/2.1/#manifest $json += [ '@type' => 'sc:Manifest', '@id' => $request_url, // If the View has a title, set the View title as the manifest label. - 'label' => $this->view->getTitle() ?: 'IIIF Manifest', + 'label' => $this->view->getTitle() ?: $this->getEntityTitle($content_path), '@context' => 'http://iiif.io/api/presentation/2/context.json', // @see https://iiif.io/api/presentation/2.1/#sequence 'sequences' => [ @@ -260,6 +264,25 @@ class IIIFManifest extends StylePluginBase { return $canvases; } + /** + * Pull a title from the node or media passed to this view. + * + * @param string $content_path + * @return string + */ + public function getEntityTitle(string $content_path): string { + $entity_title = $this->t('IIIF Manifest'); + $params = \Drupal\Core\Url::fromUserInput($content_path)->getRouteParameters(); + if (isset($params['node'])) { + $node = \Drupal\node\Entity\Node::load($params['node']); + $entity_title = $node->getTitle(); + } elseif (isset($params['media'])) { + $media = \Drupal\media\Entity\Media::load($params['media']); + $entity_title = $media->getName(); + } + return $entity_title; + } + /** * {@inheritdoc} */ From 71b1cb5d645e2303390f42f1c1b6cc85506f1aa1 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 2 May 2022 14:25:22 +0000 Subject: [PATCH 02/13] Add try() wrapper to IIIF manifest title generate function. --- .../src/Plugin/views/style/IIIFManifest.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php index 779451c2..2dfe5011 100644 --- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php +++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php @@ -130,7 +130,6 @@ class IIIFManifest extends StylePluginBase { $content_path = implode('/', $url_components); $iiif_base_id = $request_host . '/' . $content_path; - // @see https://iiif.io/api/presentation/2.1/#manifest $json += [ '@type' => 'sc:Manifest', @@ -272,13 +271,17 @@ class IIIFManifest extends StylePluginBase { */ public function getEntityTitle(string $content_path): string { $entity_title = $this->t('IIIF Manifest'); - $params = \Drupal\Core\Url::fromUserInput($content_path)->getRouteParameters(); - if (isset($params['node'])) { - $node = \Drupal\node\Entity\Node::load($params['node']); - $entity_title = $node->getTitle(); - } elseif (isset($params['media'])) { - $media = \Drupal\media\Entity\Media::load($params['media']); - $entity_title = $media->getName(); + try { + $params = \Drupal\Core\Url::fromUserInput($content_path)->getRouteParameters(); + if (isset($params['node'])) { + $node = \Drupal\node\Entity\Node::load($params['node']); + $entity_title = $node->getTitle(); + } elseif (isset($params['media'])) { + $media = \Drupal\media\Entity\Media::load($params['media']); + $entity_title = $media->getName(); + } + } catch (\InvalidArgumentException $e) { + } return $entity_title; } From 92d5a7fbbde578b6ea37b27b819cddd521b998a4 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 5 May 2022 19:14:54 +0000 Subject: [PATCH 03/13] Fix Coder errors in IIIF views style plugin. --- .../src/Plugin/views/style/IIIFManifest.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php index 2dfe5011..0ebc213e 100644 --- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php +++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php @@ -5,6 +5,7 @@ namespace Drupal\islandora_iiif\Plugin\views\style; use Drupal\views\Plugin\views\style\StylePluginBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Messenger\MessengerInterface; +use Drupal\Core\Url; use Drupal\views\ResultRow; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Serializer\SerializerInterface; @@ -267,20 +268,25 @@ class IIIFManifest extends StylePluginBase { * Pull a title from the node or media passed to this view. * * @param string $content_path + * The path of the content being requested. + * * @return string + * The entity's title. */ public function getEntityTitle(string $content_path): string { $entity_title = $this->t('IIIF Manifest'); try { - $params = \Drupal\Core\Url::fromUserInput($content_path)->getRouteParameters(); + $params = Url::fromUserInput($content_path)->getRouteParameters(); if (isset($params['node'])) { - $node = \Drupal\node\Entity\Node::load($params['node']); + $node = \Drupal::entityTypeManager()->getStorage('node')->load($params['node']); $entity_title = $node->getTitle(); - } elseif (isset($params['media'])) { - $media = \Drupal\media\Entity\Media::load($params['media']); + } + elseif (isset($params['media'])) { + $media = \Drupal::entityTypeManager()->getStorage('media')->load($params['media']); $entity_title = $media->getName(); } - } catch (\InvalidArgumentException $e) { + } + catch (\InvalidArgumentException $e) { } return $entity_title; From 52d3df1462f7df95b20d51a9e8798b9f188509ee Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 12 May 2022 19:06:32 +0000 Subject: [PATCH 04/13] Suppress 'Schema incomplete' error in Functional test. --- .../src/Functional/IslandoraImageFormatterTest.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/src/Functional/IslandoraImageFormatterTest.php b/tests/src/Functional/IslandoraImageFormatterTest.php index 2793cf49..75003463 100644 --- a/tests/src/Functional/IslandoraImageFormatterTest.php +++ b/tests/src/Functional/IslandoraImageFormatterTest.php @@ -10,6 +10,11 @@ namespace Drupal\Tests\islandora\Functional; */ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { + /** + * @var bool Suppresses "Schema incomplete" error. + */ + protected $strictConfigSchema = FALSE; + /** * @covers \Drupal\islandora\Plugin\Field\FieldFormatter\IslandoraImageFormatter::viewElements */ @@ -26,15 +31,16 @@ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { // Create an image media type. $testImageMediaType = $this->createMediaType('image', ['id' => 'test_image_media_type']); $testImageMediaType->save(); - $this->createEntityReferenceField('media', $testImageMediaType->id(), 'field_media_of', 'Media Of', 'node', 'default', [], 2); - + $this->createEntityReferenceField('media', $testImageMediaType->id(), 'field_media_of', 'Media Of', 'node', 'default', [], 2);("Got past create media type."); // Set the display mode to use the islandora_image formatter. // Also, only show the image on display to remove clutter. $display_options = [ 'type' => 'islandora_image', - 'settings' => ['image_style' => NULL, 'image_link' => 'content'], + 'settings' => [/*'image_style' => NULL,*/ 'image_link' => 'content'], ]; + $display = $this->container->get('entity_display.repository')->getViewDisplay('media', $testImageMediaType->id(), 'default'); + $display->setComponent('field_media_image', $display_options) ->removeComponent('created') ->removeComponent('uid') @@ -47,7 +53,6 @@ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { 'title' => 'Test Node', ]); $node->save(); - // Make a image for the Media. $file = $this->container->get('entity_type.manager')->getStorage('file')->create([ 'uid' => $account->id(), From 11bc7886ea13d6d5b674d8fb16ff7b17f09ee834 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 13 May 2022 19:20:40 +0000 Subject: [PATCH 05/13] Update islandora_image schema to fix failing test. --- config/schema/islandora.schema.yml | 8 ++++++++ .../Functional/IslandoraImageFormatterTest.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/config/schema/islandora.schema.yml b/config/schema/islandora.schema.yml index de7a3e46..0ee69fc1 100644 --- a/config/schema/islandora.schema.yml +++ b/config/schema/islandora.schema.yml @@ -169,3 +169,11 @@ field.formatter.settings.islandora_image: image_style: type: string label: 'Image style' + image_loading: + type: mapping + label: 'Image loading settings' + mapping: + attribute: + type: string + label: 'Loading attribute' + diff --git a/tests/src/Functional/IslandoraImageFormatterTest.php b/tests/src/Functional/IslandoraImageFormatterTest.php index 75003463..33f6e1e6 100644 --- a/tests/src/Functional/IslandoraImageFormatterTest.php +++ b/tests/src/Functional/IslandoraImageFormatterTest.php @@ -10,11 +10,6 @@ namespace Drupal\Tests\islandora\Functional; */ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { - /** - * @var bool Suppresses "Schema incomplete" error. - */ - protected $strictConfigSchema = FALSE; - /** * @covers \Drupal\islandora\Plugin\Field\FieldFormatter\IslandoraImageFormatter::viewElements */ @@ -31,16 +26,21 @@ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { // Create an image media type. $testImageMediaType = $this->createMediaType('image', ['id' => 'test_image_media_type']); $testImageMediaType->save(); - $this->createEntityReferenceField('media', $testImageMediaType->id(), 'field_media_of', 'Media Of', 'node', 'default', [], 2);("Got past create media type."); + $this->createEntityReferenceField('media', $testImageMediaType->id(), 'field_media_of', 'Media Of', 'node', 'default', [], 2); // Set the display mode to use the islandora_image formatter. // Also, only show the image on display to remove clutter. $display_options = [ 'type' => 'islandora_image', - 'settings' => [/*'image_style' => NULL,*/ 'image_link' => 'content'], + 'settings' => [ + 'image_style' => '', + 'image_link' => 'content', + 'image_loading' => [ + 'attribute' => 'eager', + ], + ], ]; $display = $this->container->get('entity_display.repository')->getViewDisplay('media', $testImageMediaType->id(), 'default'); - $display->setComponent('field_media_image', $display_options) ->removeComponent('created') ->removeComponent('uid') From f6fa77984b08e78372a50984292fe0b49aa2fce8 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 16 May 2022 16:29:05 +0000 Subject: [PATCH 06/13] Islandora Image schema inherits from parent. --- config/schema/islandora.schema.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/config/schema/islandora.schema.yml b/config/schema/islandora.schema.yml index 0ee69fc1..c98679eb 100644 --- a/config/schema/islandora.schema.yml +++ b/config/schema/islandora.schema.yml @@ -158,22 +158,6 @@ condition.plugin.node_had_namespace: pid_field: type: ignore label: 'PID field' - field.formatter.settings.islandora_image: - type: mapping - label: 'Image field display format settings' - mapping: - image_link: - type: string - label: 'Link image to' - image_style: - type: string - label: 'Image style' - image_loading: - type: mapping - label: 'Image loading settings' - mapping: - attribute: - type: string - label: 'Loading attribute' - + type: field.formatter.settings.image + label: 'Islandora image field display format settings' From e5a1f99c5710b051bb22f23a36d04b9110bf3787 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 19 May 2022 13:58:29 +0000 Subject: [PATCH 07/13] IIIF Manifest: Use dependency injection for EntityTypeManager service. --- .../src/Plugin/views/style/IIIFManifest.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php index 0ebc213e..13f83e7d 100644 --- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php +++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php @@ -3,6 +3,7 @@ namespace Drupal\islandora_iiif\Plugin\views\style; use Drupal\views\Plugin\views\style\StylePluginBase; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Url; @@ -69,6 +70,13 @@ class IIIFManifest extends StylePluginBase { */ protected $iiifConfig; + /** + * The Drupal Entity Type Manager service. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + /** * The Drupal Filesystem. * @@ -86,12 +94,13 @@ class IIIFManifest extends StylePluginBase { /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, SerializerInterface $serializer, Request $request, ImmutableConfig $iiif_config, FileSystemInterface $file_system, Client $http_client, MessengerInterface $messenger) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, SerializerInterface $serializer, Request $request, ImmutableConfig $iiif_config, EntityTypeManagerInterface $entity_type_manager, FileSystemInterface $file_system, Client $http_client, MessengerInterface $messenger) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->serializer = $serializer; $this->request = $request; $this->iiifConfig = $iiif_config; + $this->entityTypeManager = $entity_type_manager; $this->fileSystem = $file_system; $this->httpClient = $http_client; $this->messenger = $messenger; @@ -108,6 +117,7 @@ class IIIFManifest extends StylePluginBase { $container->get('serializer'), $container->get('request_stack')->getCurrentRequest(), $container->get('config.factory')->get('islandora_iiif.settings'), + $container->get('entity_type.manager'), $container->get('file_system'), $container->get('http_client'), $container->get('messenger') @@ -278,11 +288,11 @@ class IIIFManifest extends StylePluginBase { try { $params = Url::fromUserInput($content_path)->getRouteParameters(); if (isset($params['node'])) { - $node = \Drupal::entityTypeManager()->getStorage('node')->load($params['node']); + $node = $this->entityTypeManager->getStorage('node')->load($params['node']); $entity_title = $node->getTitle(); } elseif (isset($params['media'])) { - $media = \Drupal::entityTypeManager()->getStorage('media')->load($params['media']); + $media = $this->entityTypeManager->getStorage('media')->load($params['media']); $entity_title = $media->getName(); } } From b38f195a50745fc89b15d9d5b462f850403e04f9 Mon Sep 17 00:00:00 2001 From: Seth Shaw Date: Thu, 19 May 2022 09:01:23 -0700 Subject: [PATCH 08/13] Produce error if viewing a media without a source file --- islandora.module | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index e2688867..e29fdb56 100644 --- a/islandora.module +++ b/islandora.module @@ -422,7 +422,7 @@ function islandora_entity_extra_field_info() { if (!empty($pseudo_bundles)) { foreach ($pseudo_bundles as $key) { - list($bundle, $content_entity) = explode(":", $key); + [$bundle, $content_entity] = explode(":", $key); $extra_field[$content_entity][$bundle]['display']['field_gemini_uri'] = [ 'label' => t('Fedora URI'), 'description' => t('The URI to the persistent'), @@ -451,6 +451,17 @@ function islandora_entity_view(array &$build, EntityInterface $entity, EntityVie // Check if the source file is in Fedora or not. $media_source_service = \Drupal::service('islandora.media_source_service'); $source_file = $media_source_service->getSourceFile($entity); + if (!$source_file) { + \Drupal::logger('islandora')->error( + \Drupal::service('string_translation')->translate( + "Can't get source file for @label (@id)", [ + '@label' => $entity->label(), + "@id" => $entity->id(), + ] + ) + ); + return; + } $uri = $source_file->getFileUri(); $scheme = \Drupal::service('stream_wrapper_manager')->getScheme($uri); $flysystem_config = Settings::get('flysystem'); From 222c9601c13d24e7f89922260cd8c4f89a554e97 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Wed, 1 Jun 2022 14:38:00 -0300 Subject: [PATCH 09/13] Rename multifile media ocr derivative type. (#875) * Rename multifile media ocr derivative type. * Remove errant 10.0.x/php 8.0 test --- .github/workflows/build-2.x.yml | 21 ------------------- .../Action/GenerateOCRDerivativeFile.php | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 80c58187..f5bce510 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -77,11 +77,6 @@ jobs: mysql: "8.0" test-suite: "functional-javascript" allowed_failure: true - - drupal-version: '10.0.x-dev' - php-versions: '8.0' - mysql: "8.0" - test-suite: "kernel" - allowed_failure: true # 9.4.x-dev on PHP 8.1 - drupal-version: '9.4.x-dev' php-versions: '8.1' @@ -98,22 +93,6 @@ jobs: mysql: "8.0" test-suite: "functional-javascript" allowed_failure: true - # 10.0.x-dev on PHP 8.0 - - drupal-version: '10.0.x-dev' - php-versions: '8.0' - mysql: "8.0" - test-suite: "kernel" - allowed_failure: true - - drupal-version: '10.0.x-dev' - php-versions: '8.0' - mysql: "8.0" - test-suite: "functional" - allowed_failure: true - - drupal-version: '10.0.x-dev' - php-versions: '8.0' - mysql: "8.0" - test-suite: "functional-javascript" - allowed_failure: true # 10.0.x-dev on PHP 8.1 - drupal-version: '10.0.x-dev' php-versions: '8.1' diff --git a/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php b/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php index 3b5e8498..f6b8034a 100644 --- a/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php +++ b/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php @@ -12,7 +12,7 @@ use Drupal\islandora\Plugin\Action\AbstractGenerateDerivativeMediaFile; * * @Action( * id = "generate_extracted_text_file", - * label = @Translation("Generate an Extracted Text derivative file"), + * label = @Translation("Generate Extracted Text for Media Attachment"), * type = "media" * ) */ From 63a77bd8345f816c35cadeb170765b9dfc9cdf1e Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Fri, 3 Jun 2022 12:35:34 -0300 Subject: [PATCH 10/13] Move to int for config. --- .../islandora_core_feature/config/install/filehash.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/islandora_core_feature/config/install/filehash.settings.yml b/modules/islandora_core_feature/config/install/filehash.settings.yml index aa9c188d..ce88d0dc 100644 --- a/modules/islandora_core_feature/config/install/filehash.settings.yml +++ b/modules/islandora_core_feature/config/install/filehash.settings.yml @@ -2,4 +2,4 @@ algos: sha1: sha1 md5: '0' sha256: '0' -dedupe: false +dedupe: '0' From 61f9ec9106bd970bc46d009d5d4bda8fed7f8c53 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Fri, 3 Jun 2022 13:58:52 -0300 Subject: [PATCH 11/13] That was a string, whoops... ... was thinking it was the same kind of thing above, but I guess not. --- .../islandora_core_feature/config/install/filehash.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/islandora_core_feature/config/install/filehash.settings.yml b/modules/islandora_core_feature/config/install/filehash.settings.yml index ce88d0dc..7deecc69 100644 --- a/modules/islandora_core_feature/config/install/filehash.settings.yml +++ b/modules/islandora_core_feature/config/install/filehash.settings.yml @@ -2,4 +2,4 @@ algos: sha1: sha1 md5: '0' sha256: '0' -dedupe: '0' +dedupe: 0 From 3d122af5d66cd31219f3fc2b949130d7202316f3 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 7 Jun 2022 13:34:40 -0300 Subject: [PATCH 12/13] Avoid attempting to refer to an unknown index. (#876) When running in a bare site (without any content... like, in a unit testing rig), this ends up trying to refer to a non-existent offset. ... add an `isset()` test to avoid doing so. --- islandora.views.inc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/islandora.views.inc b/islandora.views.inc index cd826d08..ad2b141a 100644 --- a/islandora.views.inc +++ b/islandora.views.inc @@ -13,13 +13,16 @@ function islandora_views_data_alter(&$data) { $fields = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('node'); foreach ($fields as $field => $field_storage_definition) { if ($field_storage_definition->getType() == 'integer' && strpos($field, "field_") === 0) { - $data['node__' . $field][$field . '_value']['field'] = $data['node__' . $field][$field]['field']; - $data['node__' . $field][$field]['title'] = t('Integer Weight Selector (@field)', [ - '@field' => $field, - ]); - $data['node__' . $field][$field]['help'] = t('Provides a drag-n-drop reordering of integer-based weight fields.'); - $data['node__' . $field][$field]['title short'] = t('Integer weight selector'); - $data['node__' . $field][$field]['field']['id'] = 'integer_weight_selector'; + $prefixed_field = 'node__' . $field; + if (isset($data[$prefixed_field])) { + $data[$prefixed_field][$field . '_value']['field'] = $data[$prefixed_field][$field]['field']; + $data[$prefixed_field][$field]['title'] = t('Integer Weight Selector (@field)', [ + '@field' => $field, + ]); + $data[$prefixed_field][$field]['help'] = t('Provides a drag-n-drop reordering of integer-based weight fields.'); + $data[$prefixed_field][$field]['title short'] = t('Integer weight selector'); + $data[$prefixed_field][$field]['field']['id'] = 'integer_weight_selector'; + } } } } From 019572a778fc20cc6142f550a437a814f6d6409c Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 7 Jun 2022 17:16:10 -0300 Subject: [PATCH 13/13] Use the interface not the class. (#879) --- src/Commands/IslandoraCommands.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Commands/IslandoraCommands.php b/src/Commands/IslandoraCommands.php index 5209546c..bd47500a 100644 --- a/src/Commands/IslandoraCommands.php +++ b/src/Commands/IslandoraCommands.php @@ -4,7 +4,7 @@ namespace Drupal\islandora\Commands; use Consolidation\AnnotatedCommand\CommandData; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Session\AccountProxy; +use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\Session\AccountSwitcherInterface; use Drupal\Core\Session\UserSession; use Drush\Commands\DrushCommands; @@ -39,7 +39,7 @@ class IslandoraCommands extends DrushCommands { /** * {@inheritdoc} */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, AccountProxy $current_user, AccountSwitcherInterface $account_switcher) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, AccountProxyInterface $current_user, AccountSwitcherInterface $account_switcher) { $this->entityTypeManager = $entity_type_manager; $this->currentUser = $current_user; $this->accountSwitcher = $account_switcher;