Problem/Motivation

In a quest to make XML Sitemap generate proper links for multilingual sites (started with #2781603: Add support for entity translations), I saw that our usage of paths was outdated (D7-ish).

For example, on a sitemap in a different language than the default site language, the sitemap link for the frontpage did not receive the ID of the language as a suffix. ("http://site.example" instead of "http://site.example/fr").

Proposed resolution

Update all the code around storing and generating paths.

Since this is a very big change that impacts the core functionality of the module, I also had to fix all the remaining test fails on DrupalCI (30347dd and 68beef5) so we can be sure that we're not breaking anything.

Remaining tasks

None.

User interface changes

Custom paths must start with a leading slash.

API changes

Nope.

Data model changes

Paths that do not start with a slash are no longer valid.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amateescu created an issue. See original summary.

amateescu’s picture

Status: Active » Needs review
FileSize
16.42 KB

And here's a patch.

  • amateescu committed de2c029 on 8.x-1.x
    Issue #2783387 by amateescu: Rethink the way we store and use paths.
    
amateescu’s picture

Status: Needs review » Fixed

Ok, the testbot confirms that we're not breaking anything, so I committed and pushed to 8.x-1.x.

  • amateescu committed 69cb242 on 8.x-1.x
    Issue #2783387 followup: Added a test for multilingual frontpage links.
    

  • amateescu committed 7c72014 on 8.x-1.x
    Issue #2783387 followup: Temporarily disable url alias preloading...

  • amateescu committed 2e76100 on 8.x-1.x
    Issue #2783387 followup: Fix for entities that do not a have a canonical...

Status: Fixed » Closed (fixed)

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