URL aliases automatically generated for content with language set to "Not applicable" are created with that same language ("Not applicable") instead of "None".
This causes aliases to not being correctly handled and "Page not found" error is thrown when trying to access the aliased path.

Comments

Norberto Ostallo created an issue. See original summary.

juampynr’s picture

Title: Aliases created with "Not applicable" language instread of "None" » Aliases created with "Not applicable" language instead of "None"
juampynr’s picture

Status: Active » Needs review
StatusFileSize
new2.66 KB
new1.57 KB

Here is a patch that fixes the issue plus a test only patch.

The last submitted patch, 3: aliases_created_with-2666052-3.patch, failed testing.

The last submitted patch, 3: aliases_created_with-2666052-3.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 3: test_only-2666052-3.patch, failed testing.

The last submitted patch, 3: test_only-2666052-3.patch, failed testing.

juampynr’s picture

Weird, the testbot says that url_alias can't be found, while I had to remove this locally for the test to pass. Submitting a new patch.

juampynr’s picture

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

Here it is.

Status: Needs review » Needs work

The last submitted patch, 9: aliases_created_with-2666052-9.patch, failed testing.

The last submitted patch, 9: aliases_created_with-2666052-9.patch, failed testing.

berdir’s picture

+++ b/src/Tests/PathautoUnitTest.php
@@ -460,6 +460,24 @@ class PathautoUnitTest extends KernelTestBase {
+    $alias = \Drupal::service('pathauto.alias_storage_helper')->loadBySource('/node/' . $entity->id());
+    $this->assertEqual($alias['langcode'], LanguageInterface::LANGCODE_NOT_SPECIFIED, 'PathautoGenerator::createEntityAlias() adjusts the alias langcode from Not Applicable to Not Specified.');

Can you also check that accessing the alias works? NOT_APPLICABLE will not.

juampynr’s picture

Status: Needs work » Needs review
StatusFileSize
new3.61 KB
new3.62 KB

Here it is.

Status: Needs review » Needs work

The last submitted patch, 13: aliases_created_with-2666052-13.patch, failed testing.

The last submitted patch, 13: aliases_created_with-2666052-13.patch, failed testing.

juampynr’s picture

Status: Needs work » Needs review

The testbot has been drinking. Not me.

  • Berdir committed 11b8ce7 on 8.x-1.x authored by juampynr
    Issue #2666052 by juampynr: Aliases created with "Not applicable"...
berdir’s picture

Status: Needs review » Fixed

Yeah, see #2670360: Add BC layer in installSchema to support url_alias on the testbot problem. I hope we can commit that soon so we don't need a bunch of crazy checks to work with 8.0 and 8.1.

This looks good to me, committed.

Status: Fixed » Closed (fixed)

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