Attached is a patch, it checks for the existence of Drupal.settings.pathPrefix and prepends it to viewPath.
This makes if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') pass, as without the language prefix path.substring(0, viewPath.length + 1) was removing the last 3 characters of the path
Without this patch, this happens: path.substring(0, viewPath.length + 1) == en/admin/organizatio viewPath + '/' == admin/organizations/
With this patch: path.substring(0, viewPath.length + 1) == en/admin/organizations/ viewPath + '/' == en/admin/organizations/
i tested it in the dev version to help this patch to be commited.
i had the same problem: the glossary view didnt work with ajax in a multilingual site, but it worked without ajax.
i applied the patch in the dev version and now ajax works.
i hope that it can be commited to the dev version.
thanks to all people that contributes to views :)
JUST what I was looking for. I must admit it took me some time to find this thread. I wonder why this patch is not in Views 3.8...
I can confirm that patching 3.8 works as well. This is a bug though and should be fixed permanently right?
We've recently switched our testing from the old qa.drupal.org to DrupalCI. Because of a bug in the new system, #2623840: Views (D7) patches not being tested, older patches must be re-uploaded. On re-uploading the patch, please set the status to "Needs Review" so that the test bot will add it to its queue.
If all tests pass, change the Status back to "Reviewed & tested by the community". We'll most likely commit the patch immediately without having to go through another round of peer review.
We apologize for the trouble, and appreciate your patience.
Comments
Comment #1
bsuttis CreditAttribution: bsuttis commentedNarrowed it down to js/base.js
Attached is a patch, it checks for the existence of Drupal.settings.pathPrefix and prepends it to viewPath.
This makes
if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/')
pass, as without the language prefixpath.substring(0, viewPath.length + 1)
was removing the last 3 characters of the pathWithout this patch, this happens:
path.substring(0, viewPath.length + 1)
== en/admin/organizatioviewPath + '/'
== admin/organizations/With this patch:
path.substring(0, viewPath.length + 1)
== en/admin/organizations/viewPath + '/'
== en/admin/organizations/Comment #2
JulienThomas CreditAttribution: JulienThomas commentedGood afternoon.
Thank your for this patch. It solved my bug too!
Comment #3
issa.haddadin CreditAttribution: issa.haddadin commentedThank you..
It worked with me too!
Comment #4
issa.haddadin CreditAttribution: issa.haddadin commentedI tried this with latest views "7.x-3.7" version and it's working good.
Comment #5
weri CreditAttribution: weri commentedI applied this patch to 7.x-3.7 and the ajax call works also with language prefixes.
Comment #6
candelas CreditAttribution: candelas commentedthanks @bsuttis :) it works perfect.
i tested it in the dev version to help this patch to be commited.
i had the same problem: the glossary view didnt work with ajax in a multilingual site, but it worked without ajax.
i applied the patch in the dev version and now ajax works.
i hope that it can be commited to the dev version.
thanks to all people that contributes to views :)
Comment #7
e5sego CreditAttribution: e5sego commentedComment #8
e5sego CreditAttribution: e5sego commentedApplyed the patch to 7.x-3.7 which solved the problem using glossary + ajax + internationalization / i18n.
Also added i18n tag to this issue, it's might be hard to find the patch. Hope that's right.
Comment #9
alienzed CreditAttribution: alienzed commentedJUST what I was looking for. I must admit it took me some time to find this thread. I wonder why this patch is not in Views 3.8...
I can confirm that patching 3.8 works as well. This is a bug though and should be fixed permanently right?
Comment #10
dawehner1: views-language_prefix_for_ajax-1803758-1.patch queued for re-testing.
Comment #11
weri CreditAttribution: weri commentedThe patch works with 3.8 and DEV. I hope it gets added to the next release.
Comment #12
stefan.r CreditAttribution: stefan.r commentedThis works, can we get this committed?
Comment #13
bendev CreditAttribution: bendev commentedI confirm this is working for me too with Views 3.8
thank you
Comment #14
bendev CreditAttribution: bendev commentedtoo bad it was not commited yet...
Still working with views 7.X-3.10
Comment #15
stefan.r CreditAttribution: stefan.r commentedConfirming RTBC
Comment #16
Scott Robertson CreditAttribution: Scott Robertson commentedAlso confirming that this patch works for me.
Comment #17
D4K0 CreditAttribution: D4K0 as a volunteer commentedI've applied this patch to 7.X-3.11 and it fixed my broken ajax calls with language prefixes. THX.
Confirming RTBC.
Comment #18
joelpittetAny work will be done against the dev branch, that's why it's set to that.
Comment #19
leymannxExcuse me, I'm wondering why it takes 3 years for the patch to finally get merged?
Comment #20
stefan.r CreditAttribution: stefan.r commentedDoes Drupal 8 have this issue as well? core/modules/views/js/base.js has the same code...
Comment #21
D4K0 CreditAttribution: D4K0 as a volunteer commentedYes, it does.
Did some debugging on D8 RC2 version.
Noticed
Drupal.settings.pathPrefix
had changed todrupalSettings.path.pathPrefix
in D8.So that the condition should look like this
Comment #22
D4K0 CreditAttribution: D4K0 as a volunteer commentedFYI: I've already set up D8 issue https://www.drupal.org/node/2600804
Comment #23
colanWe've recently switched our testing from the old qa.drupal.org to DrupalCI. Because of a bug in the new system, #2623840: Views (D7) patches not being tested, older patches must be re-uploaded. On re-uploading the patch, please set the status to "Needs Review" so that the test bot will add it to its queue.
If all tests pass, change the Status back to "Reviewed & tested by the community". We'll most likely commit the patch immediately without having to go through another round of peer review.
We apologize for the trouble, and appreciate your patience.
Comment #24
Scott Robertson CreditAttribution: Scott Robertson commentedRe-uploading patch per #23.
Comment #25
Scott Robertson CreditAttribution: Scott Robertson commentedMarking as RTBC again now that the new tests have passed.
Comment #26
stefan.r CreditAttribution: stefan.r commentedRTBC+1, patch has been working great for months here
Comment #27
Tronux CreditAttribution: Tronux as a volunteer commentedConfirmed working with view-page+attachment glossary both having ajax enabled.
Comment #29
dawehnerCommitted and pushed to 7.x-3.x
Thank you for all the feedback and testing!
Comment #31
osopolarPatch for views 6.x-2.x, in case anybody still needs that.
Comment #32
osopolar