Getting an error:
TypeError: Illegal offset type in isset or empty in Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->validateExposed() (line 353 of /code/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php)
Which I am able to fix by applying changes in the mentioned TaxonomyIndexTid class:
- if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
+ if ($this->options['is_grouped'] && is_string($input) && isset($this->options['group_info']['group_items'][$input])) {
As Drupal 9 is fully Composer-based so changes get override time to time. Also I created a patch that also not working for me patch link
Can you add these changes for while update code these change will consider in release.
Comments
Comment #2
cilefen commentedThanks for the report. We require the steps to reproduce for bugs to understand if there is missing test coverage.
Comment #3
cilefen commented$inputnot a string in this case?Comment #4
pankaj1390 commentedBecause $input is the variable to contain value
I m using taxonomies in the page when open page it through error
Being for now can you create a patch and do let me till you review it. So for now I get this working
Comment #5
pankaj1390 commentedCreating a patch
Comment #6
pankaj1390 commentedComment #7
smulvih2I am running into this error on a site after upgrading from drupal/core 9.3.22 to 9.5.8. The page where this error happens is a view page, pretty straightforward setup, view based on content, with a taxonomy filter:
Patch #6 fixes the issue for me on this view page.
Here is error with backtrace:
Comment #8
cilefen commentedComment #9
smustgrave commentedWas previously tagged for steps to reproduce, see that's missing in the issue summary.
Typically for issues like this we need to discover why it's empty at this location. Putting just a check may be covering a bigger problem.
Regardless will need test coverage.
Comment #10
ahmad khader commentedI'm running into a similar problem after upgrading the site from 8 to 9 ,
I'm using grouped filter exposed with 'any' checked, allowing multiple values is disabled and the operation is "is one of".
the value inside $selected_group when broke is
Comment #11
aurora.luzzardiHi,
I was facing that issue, the patch solves it, but it break with the patch for this issue: https://www.drupal.org/project/drupal/issues/3357973
This issue: https://www.drupal.org/project/drupal/issues/3357973 solves both cases, I would say with more testing we can close the issue https://www.drupal.org/project/drupal/issues/3336222
Comment #13
baluertlComment #14
cilefen commentedDrupal 9 is no longer supported. There will be no further releases.
Based on comments from last year, this is a duplicate.
Comment #15
jillh68 commentedPatch that applies to 10.4.x
Comment #18
robloachThe above patch applies cleanly to Drupal 11.2.x, 11.1.x, 11.0.x, 10.*, etc. I've opened up a MR for this over at:
https://git.drupalcode.org/project/drupal/-/merge_requests/12750
Comment #19
smustgrave commentedThis was marked as a duplicate to check the parent issue
Comment #20
coaston commentedPatch #15 worked and message issue disappear from logs but Filter still does not work - it won't show any result. So this patch fixed just "message" it seems.
Comment #22
quietone commentedIt isn't clear to me why a duplicate issue was re-opened. As a duplicate, work continues in the other issue, which is #3357973: Grouped exposed filters do not work when input from user is an array.
I am restoring the duplicate status, and other meta data, of this issue and closing the MR.