Download & Extend

AJAXified glossary view arguments fail when Language URL detection enabled

Project:Views
Version:7.x-3.7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

The glossary view with AJAX enabled in combination with Language detection by URL does not work. It appears the argument does not get applied.

For instance, clicking 'F' should filter nodes that start with F, however it loads all results as if no contextual filter was provided. If I disable URL detection -- thus making the POST http://example.com/views/ajax instead of http://example.com/en/views/ajax -- it works.

If I disable AJAX, the view works as it should (/glossary/f loads with F results). Other AJAX calls in the site with the language prefix do not cause any issue.

Comments

#1

Status:active» needs review

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/

AttachmentSizeStatusTest resultOperations
views-language_prefix_for_ajax-1803758-1.patch536 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 1,555 pass(es).View details | Re-test

#2

Good afternoon.

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

#3

Thank you..

It worked with me too!

#4

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.

nobody click here