Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Jun 2018 at 14:34 UTC
Updated:
10 Oct 2022 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Jorrit commentedPlease see the attached patch.
Comment #3
damienmckennaThanks!
Comment #4
dsnopekRTBC+1! Used in Panopoly
Comment #6
damienmckennaCommitted. Thanks!
Comment #8
cboyden commentedThe patch in #2 does not apply to Views 7.x-3.21, here's a re-roll.
Comment #9
darrell_ulm commentedThe patch in #2 does not apply to Views 7.x-3.23, here's an additional re-roll.
Comment #10
darrell_ulm commentedAnd here is the file mentioned in #9
Comment #11
xlin commented@DamienMcKenna this commit was reverted by https://git.drupalcode.org/project/views/commit/fbafd79a763f19d8c06039f3...?
Comment #12
alina.basarabeanu commentedThis issue was fixed previously with the patch from #2 but we lost it with this commit https://git.drupalcode.org/project/views/commit/fbafd79a763f19d8c06039f3...
@DamienMcKenna please change this ticket back to needs review
Comment #13
demonde commentedI have a similar issue
The code in views_handler_argument_term_node_tid_depth.inc should be probably changed in a similar way from
if (count($tids->value) > 1) {to
if (is_array($tids->value) && count($tids->value) > 1) {Comment #14
mariiadeny commentedComment #15
michfuer commentedAgreed with #11 and #12, the patch in #2 appears to have been unintentionally reverted when the 7.x-3.21 security updates were merged into the 7.x-3.x branch.
A maintainer should re-open and probably set to 'Needs review' for the patch in #14.
Comment #16
damienmckennaWhoops.
PSA: this is why we need moar test coverage (-:
Comment #17
rclemings commentedEnd of security support for PHP 7.1 is about five weeks ago. Any way this patch could be in a release before then?
Comment #18
vladimirausUpdating patch with a bit of optimisation.
Comment #20
damienmckennaThis line doesn't need the extra brackets around the is_array() statement:
Comment #21
vladimirausCheers @DamienMcKenna.
Updated patch.
Comment #23
damienmckennaRerolled.
Let's fix this for the next release.
Comment #24
damienmckennaComment #25
damienmckennaComment #27
damienmckennaHow about this? I'm reverting part of the change in the hopes of limiting what causes problems, we can deal with other count() problems in another issue.
Comment #28
damienmckennaOk, this more limited change passes for both 7.4 and 8.0, so that's sufficient for now.
Comment #30
brandonpost commentedHi Damien, the patch for this issue released in 7.x-3.26 appears to be causing some problems (please see Views 7.x-3.26 breaks glossary view of taxonomy terms causing "SQLSTATE[42000]: Syntax error or access violation: 1064).
I see how patch #27 attempts to simplify the logic, but it doesn't take into account the case if $value is a nested array. The original logic did that, but the problem with the original logic is that it didn't test is_array($value) before calling count($value).
Here is a patch that reverts back to the original logic, but adds is_array($value), which solves the original issue of 'count() on non-Countable'. The patch also implements demonde's suggestion in #13 to make the same correction in views_handler_argument_term_node_tid_depth.inc.
Comment #31
brandonpost commentedJust saw another potential issue with the original logic. Here's an updated patch.
Comment #32
brandonpost commentedOne more patch also incorporating a correction to views_handler_argument_term_node_tid_depth_join.inc that VladimirAus had made in #21.
Comment #33
ethomas08 commentedPatch #32 does not work for me for the 7.x-3.26 release for the glossary bug my team is experiencing (more info in duplicate issue: https://www.drupal.org/project/views/issues/3305385)
Uploading a patch that fixes this error, from one of Damien's commits.
Comment #35
damienmckenna@ethomas08: Please clarify what happens when you tried #32, in what way did it not work?
Comment #36
damienmckennaCommitted. Again. Thank you.