Custom search path on a multilingual site

Created on 20 April 2023, over 1 year ago

Problem/Motivation

We are trying to get this module working in a multilingual environment using a custom search path. If I set the custom search path to "search/site" the user in both the cases where a user goes to "mysite/en/my-bad-path" and "mysite/fr/my-bad-path" the user always redirected to "mysite/search/site?search_api_fulltext=my bad path". If I configure the custom search path to "en/search/site" then at least the English redirect works fine, but again the French user (mysite/fr/my-bad-path) is redirected to "mysite/en/search/site?search_api_fulltext=my bad path" which is not allowed for Government of Canada websites.

Steps to reproduce

1. Install a multilingual site or use a multilingual distribution like DrupalWxt
2. Install this module
3. Configure this module as follows:
- use custom search path: TRUE
- custom search path: en/your/search/path?keys=@keys
- enable ignore language code so you don't get en/fr in your search keys
4. Go to yoursite/en/my-bad-path and see it works fine
5. Go to yoursite/fr/my-bad-path and see that it redirects to En.

Proposed resolution

One possible solution would be to make the custom search path configuration translatable, check the language and load the translation if needed. There may be other options as well.

Remaining tasks

If the decision is to make the custom search path translatable then potentially we will need a schema update for sites with this module already enabled.

User interface changes

Add a configuration translation option.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada joel_osc

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

Comments & Activities

Production build 0.71.5 2024