Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have several identical installations with one where a taxonomy used for an exposed filter has no terms (the view makes sense on that installation even if there are no terms in this filter). This triggers the following error, because the array that provides the filter options is NULL:
Error: Unsupported operand types in views_handler_filter->exposed_translate() (line 1193 of /var/www/html/sites/all/modules/contrib/views/handlers/views_handler_filter.inc).
This is resolved by initializing the options array a few lines earlier than it is currently done in the module.
Comment | File | Size | Author |
---|---|---|---|
#7 | views-error-in-exposed-vocabulary-filter-without-terms-3056715-7-D7.patch | 943 bytes | boromino |
#2 | views-error-in-exposed-vocabulary-filter-without-terms-3056715-2-D7.patch | 880 bytes | boromino |
Comments
Comment #2
boromino CreditAttribution: boromino at LakeDrops commentedComment #3
joseph.olstadpatch needs to be rerolled with 'git'
see documentation here:
Comment #4
joseph.olstadComment #5
Michael-IDA CreditAttribution: Michael-IDA at Internet Design Alliance commenteddoes patching with diff a/b no longer work on drupal.org? Forcing only git is going to lose people...
Comment #6
DamienMcKenna@Michael-IDA: we need correctly formatted diffs so that the testbot can run, as you can see this patch didn't work.
Comment #7
boromino CreditAttribution: boromino at LakeDrops commentedComment #8
boromino CreditAttribution: boromino at LakeDrops commentedComment #9
Michael-IDA CreditAttribution: Michael-IDA at Internet Design Alliance commented@DamienMcKenna,
Correctly formatted diffs is understood. The question is: Is the original, non-git, method (that worked with testbot last I knew) no longer supported?
Best,
Michael
Comment #10
DamienMcKenna@Michael-IDA: Ultimately no, whatever tool you used to create that patch did not create it in the correct format, you might check your IDE to see if it has options for creating them in a different format. That said, someone else can then recreate your changes and upload a correctly formatted patch.
Comment #11
ron_s CreditAttribution: ron_s commentedRolled out the latest Views release yesterday, and started getting complaints of a "500 ajax error" when attempting to open an Entity Reference View Widget.
Could not reproduce the issue locally, until we realized the view has an exposed filter term, and the content editors had previously removed all the terms for that taxonomy on the production site.
Applying patch #7 resolved the issue. Thank you for the quick efforts.
Comment #12
joseph.olstadNice reroll for the patch, I was going to do it for you but I thought it'd be more helpful if I just put the link to the documentation. Give a man a fish, eats for a day, teach a man to fish and he can catch his own.
Great work everyone! :)
Thanks!
Comment #14
DamienMcKennaCommitted. Thanks all.