I noticed today that if you have multiple entityreference_view_widget widgets on the same page, they will interfiere with each other.
1) Changing the page would change the page on both widgets. Fixed it with: http://drupalcode.org/project/entityreference_view_widget.git/commitdiff...
2) Using the "Apply" button to change the exposed filters would kill the selection on the left (with the form state having weird data, from the other widget).
I'm guessing that the problem comes from this code in our exposed form plugin:
// The button basically doesn't work with JS on or off, without this.
$form['submit']['#name'] = 'apply';
Would be great to know why that line is needed, how to make it not needed, or at least make it work. I tried making the #name unique, and that makes
it work, but only for one widget (which ever I choose first works, the second one fails to work).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | entityref-widget-exposed_filters_fix-1310382-5.patch | 759 bytes | zambrey |
| #3 | 1310382-field-state-field-values.patch | 2.08 KB | damien tournoud |
Comments
Comment #1
bojanz commentedNote that Views sets #name to an empty string:
I tried just unsetting #name and letting nature (Drupal) do its thing, but it still doesn't work.
When the selection disappears, watchdog tells me that the widget received a partial form state array, containing only the values of the OTHER entityreference widget, which is definitely odd.
Comment #3
damien tournoud commentedSo the problem is that we cannot rely on the form values because of
#limit_validation_error. We need to store the items in the field state.All this needs a lot of clean-up, but we are moving forward :)
Comment #4
bojanz commentedI've committed the patch in #3.
Leaving the issue open so that I can later go through this and confirm that the issue is completely gone.
Comment #5
zambrey commentedHey, seems like last commit broke exposed filters. At least for me :)
After switching to latest dev the exposed filters in reference view doesn't apply. View always shows original results.
Here's the patch that fixed that.
Comment #6
bojanz commentedMakes sense, will commit that as soon as I regain git access (weekend probably, I'm onsite with a client currently).
Comment #7
bojanz commentedFixed in #1415148: Exposed filters not applied if no element is selected.