bsuttis’s picture

Status: Active » Needs review
536 bytes
PASSED: [[SimpleTest]]: [MySQL] 1,658 pass(es). View

Narrowed 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 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/

JulienThomas’s picture

Good afternoon.

Thank your for this patch. It solved my bug too!

issa.haddadin’s picture

Thank you..

It worked with me too!

issa.haddadin’s picture

Version: 7.x-3.5 » 7.x-3.7
Status: Needs review » Reviewed & tested by the community

I tried this with latest views "7.x-3.7" version and it's working good.

weri’s picture

Priority: Normal » Major

I applied this patch to 7.x-3.7 and the ajax call works also with language prefixes.

candelas’s picture

Version: 7.x-3.7 » 7.x-3.x-dev

thanks @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 :)

e5sego’s picture

Issue summary: View changes
Issue tags: +i18n
e5sego’s picture

Applyed 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.

alienzed’s picture

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?

dawehner’s picture

weri’s picture

The patch works with 3.8 and DEV. I hope it gets added to the next release.

stefan.r’s picture

This works, can we get this committed?

bendev’s picture

I confirm this is working for me too with Views 3.8
thank you

bendev’s picture

too bad it was not commited yet...

Still working with views 7.X-3.10

stefan.r’s picture

Confirming RTBC

Scott Robertson’s picture

Also confirming that this patch works for me.

D4K0’s picture

Version: 7.x-3.x-dev » 7.x-3.11
Issue summary: View changes

I've applied this patch to 7.X-3.11 and it fixed my broken ajax calls with language prefixes. THX.
Confirming RTBC.

joelpittet’s picture

Version: 7.x-3.11 » 7.x-3.x-dev

Any work will be done against the dev branch, that's why it's set to that.

leymannx’s picture

Excuse me, I'm wondering why it takes 3 years for the patch to finally get merged?

stefan.r’s picture

Does Drupal 8 have this issue as well? core/modules/views/js/base.js has the same code...

D4K0’s picture

Yes, it does.
Did some debugging on D8 RC2 version.
Noticed Drupal.settings.pathPrefix had changed to drupalSettings.path.pathPrefix in D8.

So that the condition should look like this

  if (drupalSettings.path.pathPrefix) {
    var viewPath = drupalSettings.path.pathPrefix + viewPath;
D4K0’s picture

FYI: I've already set up D8 issue

colan’s picture

We've recently switched our testing from the old 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.

Scott Robertson’s picture

Status: Reviewed & tested by the community » Needs review
536 bytes

Re-uploading patch per #23.

Scott Robertson’s picture

Status: Needs review » Reviewed & tested by the community

Marking as RTBC again now that the new tests have passed.

stefan.r’s picture

RTBC+1, patch has been working great for months here

Tronux’s picture

Confirmed working with view-page+attachment glossary both having ajax enabled.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x-3.x
Thank you for all the feedback and testing!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.