From 080a7ccbdad490c7ff12d3d97b5a12ac180957a0 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 27 Oct 2022 14:04:15 +0200 Subject: [PATCH] D9 compatibility fixes --- modules/dcx_article_import/src/Form/ArticleImportForm.php | 2 +- modules/dcx_dropzone_ui/dcx_dropzone_ui.info.yml | 2 +- modules/dcx_entity_browser/dcx_entity_browser.info.yml | 2 +- modules/dcx_migration/dcx_migration.info.yml | 2 +- .../dcx_migration/src/Plugin/migrate/process/FileFromURL.php | 5 ++++- modules/dcx_unpublish_media/dcx_unpublish_media.info.yml | 2 +- .../src/EventSubscriber/RequestSubscriber.php | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/dcx_article_import/src/Form/ArticleImportForm.php b/modules/dcx_article_import/src/Form/ArticleImportForm.php index 924a441..1eef460 100644 --- a/modules/dcx_article_import/src/Form/ArticleImportForm.php +++ b/modules/dcx_article_import/src/Form/ArticleImportForm.php @@ -56,7 +56,7 @@ class ArticleImportForm extends FormBase { * The dcx client service. * @param \Drupal\dcx_migration\DcxImportServiceInterface $dcx_import_service * The import service. - * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory + * @param \Drupal\Core\TempStore\PrivateTempStoreFactory $temp_store_factory * The temp store factory. * @param \Drupal\Core\Session\AccountProxyInterface $user_account * The current user. diff --git a/modules/dcx_dropzone_ui/dcx_dropzone_ui.info.yml b/modules/dcx_dropzone_ui/dcx_dropzone_ui.info.yml index 27853cf..bbb89f3 100644 --- a/modules/dcx_dropzone_ui/dcx_dropzone_ui.info.yml +++ b/modules/dcx_dropzone_ui/dcx_dropzone_ui.info.yml @@ -1,7 +1,7 @@ name: DC-X Dropzone UI type: module description: 'Dropzone Element for DCX DnD' -core: '8.x' +core_version_requirement: ^8 || ^9 package: dcx dependencies: - dcx_integration:dcx_migration diff --git a/modules/dcx_entity_browser/dcx_entity_browser.info.yml b/modules/dcx_entity_browser/dcx_entity_browser.info.yml index f583f6f..7b989fd 100644 --- a/modules/dcx_entity_browser/dcx_entity_browser.info.yml +++ b/modules/dcx_entity_browser/dcx_entity_browser.info.yml @@ -1,7 +1,7 @@ name: DC-X Entity Browser type: module description: 'Entity Browser integration for dcx' -core: '8.x' +core_version_requirement: ^8 || ^9 package: dcx dependencies: diff --git a/modules/dcx_migration/dcx_migration.info.yml b/modules/dcx_migration/dcx_migration.info.yml index c9af84f..39ac20d 100644 --- a/modules/dcx_migration/dcx_migration.info.yml +++ b/modules/dcx_migration/dcx_migration.info.yml @@ -1,7 +1,7 @@ name: DC-X Migration type: module description: 'Migration of data from DC-X digital asset management.' -core: '8.x' +core_version_requirement: ^8 || ^9 package: dcx dependencies: - dcx_integration:dcx_integration diff --git a/modules/dcx_migration/src/Plugin/migrate/process/FileFromURL.php b/modules/dcx_migration/src/Plugin/migrate/process/FileFromURL.php index 0119860..88d044f 100644 --- a/modules/dcx_migration/src/Plugin/migrate/process/FileFromURL.php +++ b/modules/dcx_migration/src/Plugin/migrate/process/FileFromURL.php @@ -125,10 +125,13 @@ public function transform($value, MigrateExecutableInterface $migrate_executable $tmp_name = tempnam('temp://', 'dcx-'); file_put_contents($tmp_name, $file_data); + /** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager */ + $stream_wrapper_manager = \Drupal::service('stream_wrapper_manager'); + // Copy tempfile to destination, make sure to use canonical file uri. $uri = $this->fileSystem->copy( $tmp_name, - file_stream_wrapper_uri_normalize($destination_uri . DIRECTORY_SEPARATOR . $file_name), + $stream_wrapper_manager->normalizeUri($destination_uri . DIRECTORY_SEPARATOR . $file_name), FileSystemInterface::EXISTS_RENAME ); diff --git a/modules/dcx_unpublish_media/dcx_unpublish_media.info.yml b/modules/dcx_unpublish_media/dcx_unpublish_media.info.yml index bfbc1ca..ca70f36 100644 --- a/modules/dcx_unpublish_media/dcx_unpublish_media.info.yml +++ b/modules/dcx_unpublish_media/dcx_unpublish_media.info.yml @@ -1,7 +1,7 @@ name: DC-X Unpublish Media type: module description: 'Handels the behavior if a media is unpublished' -core: '8.x' +core_version_requirement: ^8 || ^9 package: dcx dependencies: - drupal:media (>= 8.4) diff --git a/modules/dcx_unpublish_media/src/EventSubscriber/RequestSubscriber.php b/modules/dcx_unpublish_media/src/EventSubscriber/RequestSubscriber.php index a7f3e80..52b1b51 100644 --- a/modules/dcx_unpublish_media/src/EventSubscriber/RequestSubscriber.php +++ b/modules/dcx_unpublish_media/src/EventSubscriber/RequestSubscriber.php @@ -55,7 +55,7 @@ public static function getSubscribedEvents() { /** * This method is called whenever the kernel.request event is dispatched. * - * @param \Symfony\Component\EventDispatcher\Event $event + * @param \Symfony\Contracts\EventDispatcher\Event $event * Kernel request event. */ public function kernelRequest(Event $event) {