Problem/Motivation

After #3009014: Convert path alias migrations to use entity:path_alias destination, the d6_url_alias_language is no longer used (nor needed), so it needs to be deprecated, per @mikelutz in comment #24 in that issue.

Proposed resolution

Do it :)

Remaining tasks

Code, review, etc.

User interface changes

Nope.

API changes

The migrate process plugin "d6_url_alias_language" is deprecated and there is no replacement for it.

Data model changes

Nope.

Release notes snippet

Nope.

Issue fork drupal-3087332

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

amateescu created an issue. See original summary.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

quietone’s picture

quietone’s picture

Status: Active » Needs review
quietone’s picture

Issue tags: +Migrate critical
StatusFileSize
new2.58 KB

Adding tag because this is a deprecation.

Status: Needs review » Needs work

The last submitted patch, 6: 3087332-6.patch, failed testing. View results

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new1.11 KB
new2.65 KB

Updated the deprecation message and added a comma.

huzooka’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record
  1. +++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
    @@ -11,11 +16,42 @@
    +  /**
    +   * UrlAliasLanguage constructor.
    +   *
    +   * @param array $configuration
    +   *   A configuration array containing information about the plugin instance.
    +   * @param string $plugin_id
    +   *   The plugin_id for the plugin instance.
    +   * @param mixed $plugin_definition
    +   *   The plugin implementation definition.
    +   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
    +   *   The Migration the plugin is being used in.
    +   * @param \Drupal\migrate\MigrateLookupInterface $migrate_lookup
    +   *   The migrate lookup service.
    +   * @param \Drupal\migrate\MigrateStubInterface $migrate_stub
    +   *   The migrate stub service.
    +   */
    +  // @codingStandardsIgnoreLine
    +  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, MigrateLookupInterface $migrate_lookup, MigrateStubInterface $migrate_stub) {
    

    The original __construct() method was inherited from \Drupal\Component\Plugin\PluginBase. I guess this is a copy-paste from MigrationLookup. UrlAliasLanguage does not injects the migration plugin instance nor the lookup and stub services.

    This should look like

      /**
       * {@inheritdoc}
       */
      public function __construct(array $configuration, $plugin_id, $plugin_definition) {
        @trigger_error(
          sprintf("'%s' is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. No direct replacement is provided See https://www.drupal.org/node/TBA",
            __CLASS__),
          E_USER_DEPRECATED
        );
        parent::__construct($configuration, $plugin_id, $plugin_definition);
      }
    
  2. +++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
    @@ -11,11 +16,42 @@
    +    @trigger_error('\Drupal\path\Plugin\migrate\process\d6\UrlAliasLanguage is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. No direct replacement is provided See https://www.drupal.org/node/TBA', E_USER_DEPRECATED);
    

    I guess https://www.drupal.org/node/TBA is a placeholder for the missing change record.

andypost’s picture

Related issues: +#3039240: Create a way to declare a plugin as deprecated

In #3039240-106: Create a way to declare a plugin as deprecated there's question about how we should deprecate migrations (it's blocker)

quietone’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record
StatusFileSize
new2.62 KB

@huzooka, thanks for the quick reply. And apologies, I should have, at least made the CR before asking for reviews.

Yikes! The things I am forgetting lately.

CR added and updated the deprecation messages accordingly. I didn't change the trigger_error in the constructor to use sprintf because that is now required on the deprecation policy for plugins.

I have not added an interdiff because of the small size and both messages have been changed.

quietone’s picture

Fortunately, that issue affects the migration plugin. We can, and have, deprecated source, process and destination plugins, For example, #2845483: Rename Iterator process plugin and add documentation.

huzooka’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
    @@ -12,10 +17,41 @@
    +  /**
    +   * UrlAliasLanguage constructor.
    +   *
    +   * @param array $configuration
    +   *   A configuration array containing information about the plugin instance.
    +   * @param string $plugin_id
    +   *   The plugin_id for the plugin instance.
    +   * @param mixed $plugin_definition
    +   *   The plugin implementation definition.
    +   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
    +   *   The Migration the plugin is being used in.
    +   * @param \Drupal\migrate\MigrateLookupInterface $migrate_lookup
    +   *   The migrate lookup service.
    +   * @param \Drupal\migrate\MigrateStubInterface $migrate_stub
    +   *   The migrate stub service.
    +   */
    

    Why we cannot use {@inheritdoc}?

  2. +++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
    @@ -11,11 +16,42 @@
    +  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, MigrateLookupInterface $migrate_lookup, MigrateStubInterface $migrate_stub) {
    

    $migration, $migrate_lookup and $migrate_stub aren't passed, but they are completely unnecessary. Note that the process plugin extends ProcessPluginBase.

  3. +++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
    @@ -12,10 +17,41 @@
    +    $this->migration = $migration;
    +    $this->migrateLookup = $migrate_lookup;
    +    $this->migrateStub = $migrate_stub;
    

    These are completely unnecessary

Why cannot we do what I suggested in #11.2 without sprintf()?

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new2.73 KB

Goodness, this day has been longer that I thought...

#15 1-3. Should be better, hopefully fixed.

Why cannot we do what I suggested in #11.2 without sprintf()?

11.2 looks like changing TBA to the nid of the change record. That was done. What have I missed? I found that I missed changing the version from 9.2 to 9.3. What else?

And I added a test of the trigger_error message.

Again, no interdiff as this is small and I don't think it will add value.

danflanagan8’s picture

Status: Needs review » Needs work
+++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
@@ -11,11 +13,25 @@
+ *   no_ui = true

nit: Everywhere else in core uses all caps for true: no_ui = TRUE

That's the only "what else" I noticed.

Although at this point maybe it's going to have to be 9.4...

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new2.46 KB
new2.74 KB

Changed true to TRUE and corrected the filename of the test to end with 'Test'.

danflanagan8’s picture

Status: Needs review » Reviewed & tested by the community

Good catch on the file name. I think it looks good...as long as it gets in for 9.3.0. If not that comment/message will need updating.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
@@ -2,6 +2,8 @@
+@trigger_error('The ' . __NAMESPACE__ . '\UrlAliasLanguage is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3013865', E_USER_DEPRECATED);
+

As a plugin we should not be triggering a deprecation error in the main section of the class - this should happen only on construction. This change is currently adding both.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new745 bytes
new2.35 KB

Oops. Fixing that now.

daffie’s picture

Issue summary: View changes
Status: Needs review » Needs work

The window for deprecations in D9.3 has passed, they now need to go into D9.4.

quietone’s picture

Version: 9.3.x-dev » 9.4.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.34 KB
new2.35 KB

Updated to 9.4.x.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

back to RTBC

alexpott’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Discussed with @catch and we agreed to backport this to 9.3.x to avoid having to deprecate this in Drupal 11.

diff --git a/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
index 000e0ab390..774bcf12b5 100644
--- a/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
+++ b/core/modules/path/src/Plugin/migrate/process/d6/UrlAliasLanguage.php
@@ -15,8 +15,8 @@
  *   no_ui = TRUE
  * )
  *
- * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. No direct
- * replacement is provided.
+ * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. No direct
+ *   replacement is provided.
  *
  * @see https://www.drupal.org/node/3219051
  */
@@ -26,7 +26,7 @@ class UrlAliasLanguage extends ProcessPluginBase {
    * {@inheritdoc}
    */
   public function __construct(array $configuration, $plugin_id, $plugin_definition) {
-    @trigger_error(__CLASS__ . ' is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3219051', E_USER_DEPRECATED);
+    @trigger_error(__CLASS__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3219051', E_USER_DEPRECATED);
     parent::__construct($configuration, $plugin_id, $plugin_definition);
   }
 
diff --git a/core/modules/path/tests/src/Unit/migrate/process/d6/UrlAliasLanguageDeprecatedTest.php b/core/modules/path/tests/src/Unit/migrate/process/d6/UrlAliasLanguageDeprecatedTest.php
index 6064fbdaf3..46461af3c8 100644
--- a/core/modules/path/tests/src/Unit/migrate/process/d6/UrlAliasLanguageDeprecatedTest.php
+++ b/core/modules/path/tests/src/Unit/migrate/process/d6/UrlAliasLanguageDeprecatedTest.php
@@ -18,7 +18,7 @@ class UrlAliasLanguageDeprecatedTest extends MigrateProcessTestCase {
    * Tests legacy UrlAliasLanguage process plugin.
    */
   public function testUrlAliasLanguageDeprecation() {
-    $this->expectDeprecation("Drupal\path\Plugin\migrate\process\d6\UrlAliasLanguage is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3219051");
+    $this->expectDeprecation("Drupal\path\Plugin\migrate\process\d6\UrlAliasLanguage is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3219051");
     new UrlAliasLanguage([], 'test', []);
   }
 

Move the deprecations to 9.3.0

Committed and pushed 04f2578519 to 9.4.x and c4debe7012 to 9.3.x. Thanks!

  • alexpott committed 04f2578 on 9.4.x
    Issue #3087332 by quietone, huzooka, amateescu, danflanagan8: Deprecate...

  • alexpott committed c4debe7 on 9.3.x
    Issue #3087332 by quietone, huzooka, amateescu, danflanagan8: Deprecate...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.