- Issue created by @cgmonroe
- πΊπΈUnited States cgmonroe
Here is a patch against the 3.1.0 branch (dev based patch will not install on release branch)
- π¬π§United Kingdom rachel_norfolk UK
Heh - Iβm slightly amused that it took me longer to remember how to make a test site with a base path than it did to actually test the proposed change!
With the change applied, the test site correctly takes into account the base path. It also continues to work when there isnβt a base path.
There is an update function to update aliases that might already be stored, which is also nice.
I think this is a good one. RTBC
- π¬π§United Kingdom rachel_norfolk UK
Actually, we need this against the 3.x branch, please.
If someone can create a Merge Request, someone else test it, then I will happily merge.
When testing, please consider the scenario that someone has both a base path and a translation.
- First commit to issue fork.
Created a merge request base on patch create by cgmonroe #2 but
I have remove the views_url_alias_update_88301() from the merge request as this will cause timeout issues on site with lots of url alias or contents. We have the "Rebuild views alias table" in "admin/structure/views/settings/alias" for this.Note for tester/reviewer
This require Drupal multisite setup.
Steps using ddev:
1. Install Drupal as usual.
2. Follow steps in this issue: https://www.drupal.org/project/drupal/issues/3529122#comment-16147644 π¬ Unable to set up Drupal 10 multisite using subfolders in DDEV (e.g., /site1 and /site2) ActiveAfter you have a multi site with sub directory setup, you will have something like this:
https://example.ddev.site/site1
https://example.ddev.site/site2The global base_path() function will now return /site1/ or /site2/ and
Alias entries in the views_url_alias table will have the base path prepend on the url alias.3. Install the views_url_alias module or rebuild the table if you already have it installed.
4. Create or edit an existing content views.
5. Add Content URL Alias relationship.
6. Add Content URL Alias field.
7. Add Content URL Alias exposed filter.Output:
Base path is added on the URL Alias field. E.g. /site1/node-298-article or /site2/node-298-article
You can search url alias with base path.