Having a strange issue. I have created an attachment for a view, which is for the moment simply a clone of the standard view. However, if contextual or exposed filters are inherited, the attachment automatically displays the empty text. If I remove the ability to inherit filters, the attachment displays, but then of course the exposed filters no longer work to filter the results. Not sure really what I'm doing wrong here, as I never had this issue with Drupal 6. If anyone has any tips on what I could be doing wrong here, it would be appreciated.
Comment | File | Size | Author |
---|---|---|---|
#15 | views.attachment.patch | 928 bytes | Oliver Huynh |
Comments
Comment #1
NathanM CreditAttribution: NathanM commentedAfter playing around with filters for some time, it seems that this only happens when one of the exposed filters is an "autocomplete" taxonomy term reference field. If it is a dropdown field, it filters fine and the attachment displays as expected.
Comment #2
filburt CreditAttribution: filburt commentedSame problem here...
Thanks for support!
Greetings
Filburt
Comment #3
gnal CreditAttribution: gnal commentedSame here, exposed filter with autocomplete field breaks the attachment.
Comment #4
geraud CreditAttribution: geraud commentedSame problem. Autocomplete exposed filter makes attachment view disappear.
Subscribe.
Comment #5
amirhosseinR CreditAttribution: amirhosseinR commentedtnx geraud :)
Comment #6
NathanM CreditAttribution: NathanM commentedAs this has been confirmed by several people, can we change this to a bug report?
Comment #7
prosk CreditAttribution: prosk commentedPlease i have the same issue.
I confirm that when you choose autocomplete for a taxonomy field, you can't inherit filters from a page to an attached block.
Need help on that !
Thanks a lot
Comment #8
Countzero CreditAttribution: Countzero commentedStumbled on this too, and it's very annoying. Also changing the title to reflect the infos provided.
Comment #9
Countzero CreditAttribution: Countzero commentedChanging Version to dev.
Also see : http://drupal.org/node/1026436
Possibly useful info :
- The preview seems to work well, so it's probably not SQL related.
- Setting a value for the exposed Taoxnomy term or not doesn't change anything : even an empty value breaks the attachment.
- To be more precise, the attachment DOES show, but returns No Result.
- The behaviour of autocomplete fields seems to be OK otherwise, in exposed filters or elsewhere.
Hope it can help to debug this.
Comment #10
fearlsgroove CreditAttribution: fearlsgroove commented** edit ** nevermind ...
Comment #11
menelai CreditAttribution: menelai commentedHere is the solution that helped me:
You should remove the autocomplete exposed filter in the attachment and make a contextual filter instead of it. For example, in the main view there is an exposed filter called "has taxonomy term with depth" provided with "term_node_tid_depth" variable.
Add contextual filter to the attachment: "has taxonomy term with depth". Set the same depth as on the main view. Choose "provide default value" as php-code:
Then specify validation criteria: taxonomy term, your vocabulary and term id converted from name.
PROFIT
Comment #12
redsky CreditAttribution: redsky commentedAs noted in https://www.drupal.org/node/1026436, I had this problem in views-7.x-3.10. I think these two bug reports are about the same issue. I'm not sure of the procedure for updating/closing a duplicate or marking the version from dev (noted two years ago) or 7.x-3.10 noted today.
Comment #13
Oliver Huynh CreditAttribution: Oliver Huynh as a volunteer and at Jufist commentedHi guys,
Here is the patch for this mysterious bug. Spend a while for investigating until I see the cloned views in wrong.
Not sure where it is wrong so it's better to get a fresh new views.
Comment #15
Oliver Huynh CreditAttribution: Oliver Huynh as a volunteer and at Jufist commentedPatch for bypass test
Comment #16
Simon Georges CreditAttribution: Simon Georges at Makina Corpus commentedI had the exact same bug (attachment not displaying because of a taxonomy exposed filter with autocomplete), and this patch fixed it… Thanks a lot!
I'm changing the status just to move things along about it.
Comment #17
tisteegz CreditAttribution: tisteegz commentedHad this exact issue with drupal 7.59 and views 7.x-3.20. Couldn't apply the patch but changed it manually and it all works fine now. Would be great to get this in a release.
Comment #19
seattlehimay CreditAttribution: seattlehimay commentedThank you for this patch! I have a complicated view (that does *NOT* have an autocomplete field, but does have many inherited filters) and my attachment was getting 0 results. After the patch things work correctly. I'm using Drupal 7.65 and Views 7.x-3.22.
Comment #20
FeyP CreditAttribution: FeyP as a volunteer and at werk21 commented@seattlehimay @tisteegz Could you please check, if #3040497: [Regression] Missing JOIN in attached display with taxonomy filter and inherited exposed filter fixes your issue as well? It's already in the 7.x-3.x-dev version, so you could either try that or apply the patch from the issue. This is especially likely to fix the issue, if you don't have an autocomplete and are using 7.x-3.22 like @seattlehimay.
If the patch won't fix it, we're probably missing another property in views_clone(), that we should unset, but don't. In that case it would really help us, if you could export your view and attach it here so that we can look into it more closely. Thank you for your help.
Comment #21
FeyP CreditAttribution: FeyP as a volunteer and at werk21 commentedSorry, linked to the wrong issue... Should have been #3040497: [Regression] Missing JOIN in attached display with taxonomy filter and inherited exposed filter.
Comment #22
seattlehimay CreditAttribution: seattlehimay commented@FeyP - I just tried the dev version of views on my test site, and it *DID* indeed fix the problem (complicated view, attachment with inherited filters that was previously displaying only in preview but not live on site). Thank you!!
Comment #23
FeyP CreditAttribution: FeyP as a volunteer and at werk21 commented@seattlehimay Thank you for testing the dev release and for confirming that it works in the latest dev. That's great!
@all It would still be helpful to know, whether the latest dev release or the patch I posted earlier resolves the problem for someone, who has the original problem with the autocomplete. If it doesn't work, we need an export of a broken view to investigate further. If any of you could give it a shot, that would be appreciated.