Problem/Motivation

The URLs of a filter exposed as links (using BEF) are incorrect after submitting another filter with ajax enabled. This is caused by the exposed form being rebuild after that request and the original query string of that request is used in the links. This query string contains information for the original ajax request. This information in the query string breaks the links. When clicking the links a JSON string with ajax commands is shown as plain text on the screen.

Proposed resolution

To be investigated.

Remaining tasks

To be determined.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

ricovandevin created an issue. See original summary.

ricovandevin’s picture

Title: Links filter does not work together with Default views filter when ajax is enabled » Links filter does not work together with Default (Views render element) filter when ajax is enabled
Issue summary: View changes

Improved issue title and issue summary.

ricovandevin’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

A first patch attached. It solves the issue in our case but I'm not sure it is generic enough to make the links work after an ajax request in general.

nitebreed’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev
StatusFileSize
new1.04 KB

This works for my case as well, made the patch compatible with 8.x-4.x

imclean’s picture

Version: 8.x-4.x-dev » 6.0.x-dev

I think this is still a problem with 6.0.x, but the patch doesn't seem to resolve the issue for me.

imclean’s picture

My case is similar but maybe not identical.

Using ajax:

  1. Add a grouped exposed filter
  2. Use BEF to display them as links
  3. Click on one of the links - the correct results are shown
  4. Hover over the same link - the query parameter for the grouped filter is missing
  5. Click the same link - the filter is cleared
  6. Click the same link a 3rd time - the correct results are displayed again

Clicking on an exposed link seems to affect only that link, the others in the filter display correctly until they're clicked on.

imclean’s picture

Just found my own comment: #3054261-6: Treat groups filters as standard select widgets.

The query parameter is being removed from the active link. For example, after selecting option 2 path/page?option=2 the option 2 link becomes path/page.

imclean’s picture

Actually mine's a different issue I think. It happens whether ajax is enabled or not, and can affect other grouped filter options from the one which is being clicked. They seem to lose the query parameter sometimes, I'm trying to find a pattern.

freelock’s picture

Updated patch so that it applies on 6.0.3.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Summary is incomplete.

unstatu’s picture

Fixed the variable name.

smustgrave’s picture

Can we also get a test case for this one please.

smustgrave’s picture

Version: 6.0.x-dev » 7.0.x-dev
smustgrave’s picture

Issue tags: +bef-target-7.0.2
smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)

Actually before working on this lets get steps to reproduce added.

If no steps provided can eventually be closed.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)