Problem/Motivation
The module tries to find out whether any filter (normal or conditional filter) filters by any delete column. In case it does opt out of adding a specific delete column.
To do so it loops over all conditions in the current views query and compares the name of the conditions field with the name of the deleted column/table. See line 141 of ViewsQueryAlter.php.
Unfortunately the field is not always a string but may also be a ConditionInterface. This leads to the error:
TypeError: strpos(): Argument #1 ($haystack) must be of type string, Drupal\Core\Database\Query\Condition given in strpos() (line 141 of modules/contrib/trash/src/ViewsQueryAlter.php).
Steps to reproduce
Add a custom query alter to the views query and add a query condition for a field.
Proposed resolution
Test if $condition['field'] is a string before using strpos().
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork trash-3507125
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
stborchertI've added the string check for the condition field.
Comment #6
amateescu commentedLooks great, thanks! Merged into 3.x.
Comment #7
stborchertWow, that was fast. Thank you.
Comment #8
phenaproximaThis blocks a bug fix in Drupal CMS: #3508799: Trash link is a 404 on install because no entity types are enabled.