- π¨π¦Canada dstorozhuk Chicago πΊπΈ, Toronto π¨π¦, Kyiv πΊπ¦
This issue still valid in term of adding the language filter.
I fixed in 3.x-dev the issue with saving the language dependent data toviews_url_alias
, but the filter or view query still need to added to make sure we can filter by specific/current language. murat_kekic β made their first commit to this issueβs fork.
The latest code wasn't selecting the correct entity translation.
It always picked the entity translation in the current user's language because the entity was resolved with the router service.
This issue can be reproduced by running a Pathauto bulk regenerate for all aliases on a multilingual entity.I refactored the
views_url_alias_get_path_entity_type
function to ensure it handles entity translations properly when applicable.However, I had to remove the
views_url_alias_pathauto_alias_alter
hook function. The comment in the hook says itβs for saving aliases during bulk updatesfunction views_url_alias_pathauto_alias_alter(&$alias, array &$context) { // Save alias during bulk update.
, but I donβt see how thatβs the relevant place to save the data. Is it a workaround for something?
- π΅π°Pakistan dewancodes
After I had installed this module on Drupal 10.2.3, I added a relationship in the views for 'URL alias', the related views page is broken. It is not working correctly on a multilingual website.
- πͺπΈSpain manuel garcia
Im not sure if this is 100% the same problem as this, but I couldn't find anything closer already opened and this seems to be at least related, so I wanted to leave here a report of the problem we are having with the module in a multilingual installation:
So we have two nodes, one in english and one spanish, both with different URL aliases:
- English node has this URL alias:
/testing123
- Spanish node has this URL alias:
/testing123345345
However this is the results displayed by the view:
There are two problems:
- The english (original) row displays the URL alias of the Spanish translation.
- The spanish (translated) row displays nothing .
Looking at
views_url_alias_save()
looks like the entity's language are being taking into account, so not sure what is causing the problem... - English node has this URL alias:
- πͺπΈSpain manuel garcia
Spent some time on this today, turns out that the
langcode
was not being saved correctly to the DB among other things.In the attached patch:
- Added proper
langcode
handling in path alias operations - Added language field support in views integration
- Added language-aware relationships in Views
- Fixed multilingual URL alias handling
With this we are able to list the correct URL alias depending on the language of the entity being displayed:
- Added proper