Filtering parts NOT contained in a project doesn't work correctly
Describe the bug If I try to exclude parts contained in a certain project from a list (Tab "Projects", "Project", "Is not"), it does not work if the part is contained in two (or more?) projects. Those will still be shown.
To Reproduce
- Create two projects (Project-A, Project-B)
- Create two parts (Part-1, Part-2)
- Add Part-1 to Project-A and Project-B
- Add Part-2 to Project-A
- Search for "Part" and exclude all parts in Project-A
- You will still see Part-1
Expected behavior An empty list.
Server Side
- Part-DB Version: 1.11.3 (master/96f5b2b)
- PHP Version: 8.1.27 (SAPI: fpm-fcgi)
- Database Server MySQL 8.0.35
Desktop (please complete the following information):
- Browser Safari
This comes from the way that this filters a nested property retrieved via join. The "NOT" condition is fulfilled, if there is any part/project relation, where the project is not the selected one. This caused more parts to show up, then you might would expect.
However I could not think of a way, that filter in SQL that none of the joined ProjectBOMInfo elements associated with a part must be matching the projected for which should be filtered for.
So I am afraid there is no good fix for this with the way the filter system works.