Closed (fixed)
Project:
Trash
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Oct 2023 at 23:02 UTC
Updated:
17 Nov 2023 at 08:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
twodInitial attempt at fixing this. My Views no longer crash and by default they only include non-deleted entities.
I'm not very used to altering Views queries so could use some help making sure this is correct.
I noted Trash does not modify entity queries if you tell them to look at all revisions, but I think it makes more sense to actually do this for Views.
This could use some tests with revision based Views as well.
Comment #4
amateescu commentedI've been going back and forth through this code for the past week, and in addition to the problem described in the issue summary, it also doesn't handle entity references very well: a filter on the
deletedfield might be added to the view on either the base (data) table or the revision (data) table of the referenced entity type, and we're currently not checking for the second case.Here's a patch based on the MR from #2 which fixes both problems and cleans up the class a little. I've done quite a bit of manual testing, but I'd love at least another confirmation if you have the time @TwoD.
I agree, and it makes sense to do the same for entity queries as well, but we'll need another issue for that.
Comment #7
amateescu commentedTransferring commit credit from #3361703: Views integrartion: using a relation to an entity with trash ebaled results in SQL error.
Comment #8
amateescu commentedComment #10
amateescu commentedTested on a few more views and I'm comfortable enough with those changes, so committed and pushed to 3.x, thanks everyone!