Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When Lingotek module downloads translated URL aliases it checks them through \Drupal::pathValidator()->isValid(). The pathValidator service checks that the path is actually routed and accessible to the current user, thus it will always return false for new aliases.
If I understand the motivation behind the original issue and patch at #2844532: When URLs are translated with Lingotek, we must validate them before storing, the alias portions should probably just be using UrlHelper::isValid() to check syntax.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2928420-alias-not-stored-6.patch | 7.35 KB | penyaskito |
| |||
#6 | 2928420-alias-not-stored-6.only-tests.patch | 5.36 KB | penyaskito |
#6 | 2928420-alias-not-stored.interdiff.4-6.txt | 5.38 KB | penyaskito |
#4 | 2928420-alias-not-stored-4.patch | 2.74 KB | penyaskito |
#4 | 2928420-alias-not-stored-4.only-tests.patch | 1.24 KB | penyaskito |
Comments
Comment #2
krlucas CreditAttribution: krlucas commentedAttached is a quick and dirty patch. No tests yet so leaving as needs work.
Comment #3
charginghawk CreditAttribution: charginghawk as a volunteer commentedLet's see what happens with the tests.
Comment #4
penyaskitoSomehow I missed this issue :-/.
path.module already creates the alias from the alias property, so even with that patch we would be duplicating aliases, and the first one will be the original one. Setting the property and letting the path module do its job works for me.
See attached patch with tests. No interdiff but it's easy to spot the difference.
Comment #6
penyaskitoFixed the pathauto tests. Actually changed behavior, we don't want pathauto to override anything if there was a valid translation.
Comment #8
penyaskitoSetting to needs review for testbot.
Giving attribution to @Phil_b who also reported this issue and @charginghawk.
Comment #10
penyaskitoTests passed and failed as expected.
Comment #12
penyaskitoCommitted ab68126 and pushed to 8.x-2.x. Thanks!
Comment #13
charginghawk CreditAttribution: charginghawk as a volunteer commentedThanks!