diff --git a/src/Plugin/migrate/process/Service.php b/src/Plugin/migrate/process/Service.php index cd91028096ce61d7a683eccb9a63161e892b48a2..51fec0ff0b3bf553d887e38af0dacf9dc80be7ce 100644 --- a/src/Plugin/migrate/process/Service.php +++ b/src/Plugin/migrate/process/Service.php @@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides a plugin to use a callable from a service class. * - * Example: + * Examples: * * @code * process: @@ -20,6 +20,27 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * source: filename * @endcode * + * @code + * source: + * # plugin ... + * constants: + * langcode: en + * slash: / + * process: + * transliterated_value: + * plugin: service + * service: transliteration + * method: transliterate + * unpack_source: true + * source: + * - original_value + * - constants/langcode + * - constants/slash + * @endcode + * + * Since Drupal 9.2.0, it is possible to supply multiple arguments using + * unpack_source property. See: https://www.drupal.org/node/3205079 + * * All options for the callback plugin can be used, except for 'callable', * which will be ignored. * diff --git a/src/Plugin/migrate/process/Transliteration.php b/src/Plugin/migrate/process/Transliteration.php index f6cd6f7d1353d52d4c0fe8ffadb32a83058008c5..1ee48da58a84a5d86b8deced5bb692c74cf23923 100644 --- a/src/Plugin/migrate/process/Transliteration.php +++ b/src/Plugin/migrate/process/Transliteration.php @@ -34,6 +34,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * @MigrateProcessPlugin( * id = "transliteration" * ) + * + * @deprecated in migrate_plus:8.x-5.3 and is removed from migrate_plus:6.0.0. + * Use 'service' process plugin instead. See https://www.drupal.org/node/3255994 + * + * @see https://www.drupal.org/node/3255994 */ class Transliteration extends ProcessPluginBase implements ContainerFactoryPluginInterface { @@ -57,6 +62,7 @@ class Transliteration extends ProcessPluginBase implements ContainerFactoryPlugi * The transliteration service. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, TransliterationInterface $transliteration) { + @trigger_error(__CLASS__ . ' is deprecated in migrate_plus:8.x-5.3 and is removed from migrate_plus:6.0.0. Use Drupal\migrate_plus\Plugin\migrate\process\Service process plugin instead. See https://www.drupal.org/node/3255994', E_USER_DEPRECATED); parent::__construct($configuration, $plugin_id, $plugin_definition); $this->transliteration = $transliteration; } diff --git a/tests/src/Unit/process/TransliterationTest.php b/tests/src/Unit/process/TransliterationTest.php index 2ed635656e6ce38dd5dccab4388fb14263a40d69..f38bde0f0f5f67d275febc64907647668950c85d 100644 --- a/tests/src/Unit/process/TransliterationTest.php +++ b/tests/src/Unit/process/TransliterationTest.php @@ -48,4 +48,14 @@ class TransliterationTest extends MigrateProcessTestCase { $this->assertEquals($expected_result, $value); } + /** + * Tests deprecation notice of Transliteration process plugin. + * + * @group legacy + */ + public function testDeprecationMessage() { + $this->expectDeprecation("Drupal\migrate_plus\Plugin\migrate\process\Transliteration is deprecated in migrate_plus:8.x-5.3 and is removed from migrate_plus:6.0.0. Use Drupal\migrate_plus\Plugin\migrate\process\Service process plugin instead. See https://www.drupal.org/node/3255994"); + new Transliteration([], 'transliteration', [], $this->transliteration); + } + }