Part-DB-server icon indicating copy to clipboard operation
Part-DB-server copied to clipboard

Filtering parts NOT contained in a project doesn't work correctly

Open frank-f opened this issue 1 year ago • 1 comments

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

  1. Create two projects (Project-A, Project-B)
  2. Create two parts (Part-1, Part-2)
  3. Add Part-1 to Project-A and Project-B
  4. Add Part-2 to Project-A
  5. Search for "Part" and exclude all parts in Project-A
  6. 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

frank-f avatar Mar 28 '24 10:03 frank-f

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.

jbtronics avatar Apr 28 '24 16:04 jbtronics