Problem/Motivation
flag_views_query_substitutions() includes a condition to only work on the query, when the view includes a flag relationship.
But !in_array('flagging', $view->getBaseTables()) is always TRUE, since $view->getBaseTables() returns an array where all values equal TRUE, and where the table names are actually the keys.
Steps to reproduce
- Enable the flag module.
- Navigate to any page including a view.
- flag_views_query_substitutions() gets executed and the condition is verified.
Proposed resolution
Replace the check with one using array_key_exists()
Remaining tasks
Make the edit and create a MR.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #3
arousseau commentedComment #4
deaom commentedCan confirm this is happening. Checked on the admin/content view and the condition is always true. MR solved the issue.
Comment #7
ivnish