Bug 38196

Summary: Filter out concerns by specific status does not include concern without status
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35628    
Bug Blocks:    

Description Jonathan Druart 2024-10-17 14:31:34 UTC
You can filter out concerns by status (ie. linked with TICKET_STATUS AV).

But if you use this "Filter" link on top of the page to remove the concerns with this specific status, it will also remove the concerns without a specific status.

concern 1 | Open
concern 2 | Resolved
concern 3 | status_1
concern 4 | status_2

"Filter status_1" should remove concern 3 only. However it will only show concern 4.

This is because the query is ([-and => {status => { '!=' => "status_1" }}])

And does not include status that are NULL in DB.

use Koha::Tickets;
my $t = Koha::Tickets->search;
say $_->status // "undefined" for $t->as_list;
say "===";
$t = Koha::Tickets->search([-and => {status => { '!=' => "status_1" }}]);
say $_->status for $t->as_list;

undefined
undefined
status_1
status_2
===
status_2
Comment 1 Jonathan Druart 2024-10-17 14:33:11 UTC
I could fix but only on top of bug 33484 (to prevent conflicts).