Commit 028a0a14 authored by Ivan Doroshenko's avatar Ivan Doroshenko Committed by Lucas Hedding
Browse files

Resolve #3232488 "Deprecate transliteration plugin"

parent 4f7fe5a3
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -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.
 *
+6 −0
Original line number Diff line number Diff line
@@ -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;
  }
+10 −0
Original line number Diff line number Diff line
@@ -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);
  }

}