Option to keep language prefix in URLs

Created on 20 September 2023, 9 months ago
Updated 15 December 2023, 7 months ago

Problem/Motivation

In Drupal commerce, we can use store IDs like fr, tr. The functionality behaves these as language and deletes them.

For example: /fr/tr (/storeid/langid) become /tr (/langid)

Or, if you have links that include a language prefix, they can be stripped and end up breaking the links. See test failures at #2418369-62: [PP-1] Internal URL handling (language prefixes, base://, ...) β†’ .

Steps to reproduce

Proposed resolution

Add a setting to toggle the behavior if language prefixes should be stripped out of URLs. Default to leaving the URL alone for new sites, but add a post_update to set the setting to strip language prefixes for existing sites (to match current behavior).

Remaining tasks

User interface changes

New checkbox setting:

[ ] Keep language prefix
If not checked, URL prefixes that match configured languages will be removed from links.

See screenshot of the new settings UI β†’ .

API changes

Data model changes

New global and format setting schema. pathologic_post_update_set_keep_language_prefix() sets the value to FALSE on existing sites to maintain legacy behavior.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΉπŸ‡·Turkey emircanerkul Turkey

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024