Updated: Comment #15

Problem/Motivation

Steps to reproduce:

1. Install drupal and edit the frontpage view
2. Click to edit the first filter under "Filter criteria"
3. Check "Expose this filter to visitors, to allow them to change it" checkbox

Nothing happens. I think it should provide more options. Also, after clicking Apply and repeating step 2, the checkbox is not checked anymore.

(from Jan 26 2014 in 2182109)

Non-js

js

Proposed resolution

?

Remaining tasks

?

User interface changes

No.

API changes

No.

Might have been caused by

#1851414: Convert Views to use the abstracted dialog modal
or
#1342198: Use .on and .off instead of .bind, .unbind and .delegate

Other issues marked duplicate of this one:

#2217551: Cannot expose a filter in Views UI
#2182109: Exposed filter setttings not working
#2145147: Impossible to define an exposed filter with views ui

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

olli’s picture

Priority: Normal » Critical
Status: Active » Needs review
FileSize
4.52 KB

Adding '#ajax' everywhere makes it work, but I dont think this is the correct solution. Views used to do this automatically before the dialog conversion.

Peter Muusers’s picture

I just ran into the same issue and used the patch, which seemed to perfectly solve the problems I had.

s_gupta_14’s picture

Patch solves the problem for me

catch’s picture

dawehner’s picture

Component: views_ui.module » javascript

I am really sure that this is rather more a bug in states.

nod_’s picture

It doesn't use #states, checking the box makes an ajax request that is supposed to replace the form. LTried a couple things, all I ended up with is a redirect to a page displaying the json of the ajax callback.

nod_’s picture

Component: javascript » views_ui.module

Not a javascript issue. Patch fixes the problem.

Or if it's an issue with the JS it's a views_ui issue that's related to JS. Right now it looks like the ajax form isn't prepared properly and the js triggering the submission submit an actual form, not an ajax form.

andyceo’s picture

1: drupal-2130205-1.patch queued for re-testing.

dawehner’s picture

mhhhh

wiifm’s picture

I can +1 for the patch in #1, it solved the issue I was having.

tim.plunkett’s picture

Issue tags: +Stalking Crell

So this fix works, as people have said. But it seems like it should not be needed, and it also uses a procedural function that I'm pretty sure we want to kill.

So what is the way forward here?

dawehner’s picture

I would really like to know why this is a bug in the views_ui module. We haven't changed our usage of the code ...
Let's try to find a solution either in PHP or the JS side of the ajax system.

rbayliss’s picture

FileSize
5.12 KB

An alternative solution that avoids using current_path().

Status: Needs review » Needs work

The last submitted patch, 13: drupal-2130205-13.patch, failed testing.

damiankloip’s picture

FileSize
3.62 KB

Here is a reroll with the code from DisplayPluginBase removed, since we removed the theme stuff a little while ago.

I agree with Daniel that it would be nice to fix this in a more generic case. However, I think this may be an artefact of the modal conversion? And the views UI "Checkboxifier" is pretty views specific.

damiankloip’s picture

Status: Needs work » Needs review
lauriii’s picture

Tested this manually, seems to fix the described issue. I recommend this to be RTBC.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I really really hate that we need to do that, though let's be pragmatic for now.

webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Stalking Crell +Needs followup

Confirmed this fixes the bug. However, as a developer, I never would've guessed in a million years that adding a magical class to my form element suddenly made AJAX work. Let's get a follow-up to take a look at the AJAX API and see if there's a more obvious/easier way for modules to register with the system, so this bug could've been avoided.

Also, since we're no longer doing current_path() here, un-stakling Crell.

Committed and pushed to 8.x. Thanks!

  • Commit 5efa7d5 on 8.x by webchick:
    Issue #2130205 by damiankloip, rbayliss, olli: Unable to "Expose this...
nod_’s picture

Status: Fixed » Closed (fixed)

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