Problem/Motivation
The group filter functionality on the content management page causes an error when the Group module is installed but not the Group Node child module.
Steps to reproduce
- Have a Drupal 8 site with the Lingotek module installed and setup along with the Group module also setup for users. The Group Node module should not be installed.
- Attempt to use the "Group" filter on the content management page.
- The page will error and the user is then unable to access the content management page again.
Error Message
Drupal\Core\Database\InvalidQueryException: Query condition 'group_content.type IN ()' cannot be empty. in Drupal\Core\Database\Query\Condition->condition() (line 105 of core/lib/Drupal/Core/Database/Query/Condition.php).
Proposed resolution
I think this issue might be solvable if rather than checking for the Group module before enabling the group filter, the module should instead check for the Group Node module as it looks like filtering by group may currently assume groups are configured for nodes anyway.
Remaining tasks
n/a
User interface changes
n/a
API changes
n/a
Data model changes
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | lingotek-group_filter_issue-3199144-6.patch | 3.63 KB | penyaskito |
| #6 | lingotek-group_filter_issue-3199144-6.only-tests.patch | 1.67 KB | penyaskito |
| #4 | lingotek-group_filter_issue-3199144-3.patch | 1.96 KB | ben-ryder |
| #2 | lingotek-group_filter_issue-3199144-2.patch | 613 bytes | ben-ryder |
Comments
Comment #2
ben-ryder commentedAdded an initial patch file based on my suggested fix.
In isolation on the site I found this issue on, this stops the group filter being displayed as expected.
When I installed the group node module (gnode) the filter is then shown as expected.
Comment #3
penyaskitoThanks for the patch!
Comment #4
ben-ryder commentedNo problem, happy to help.
During some more testing I found I'd missed two other occurrences of that module check, so my latest patch includes the same change for those occurrences too. My mistake!
Also sorry for the mismatch in comment vs patch file number now, I didn't see your comment until I'd uploaded my new patch :)
Comment #6
penyaskitoThanks a lot for the new patch!
Code looks good.
Added fix for the failing unit test, that needed to be adapted.
Added a new test for testing this new specific scenario.
Added only-tests patch that should fail, to show that you fixed the problem.
Comment #8
penyaskitoTests passed and failed as expected.
Comment #9
hlopez commentedTested and reviewed patch. Looks good, thanks!
Comment #11
penyaskitoCommitted d7fb26b and pushed to 3.5.x. Thanks!
Cherry-picked 0a614b9 and pushed to 3.6.x. Thanks!