Bug 40682 - Koha::ILL::Request->status inconsistencies
Summary: Koha::ILL::Request->status inconsistencies
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-20 19:36 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-08-22 11:39 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2025-08-20 19:36:40 UTC
The method for overriding the setter is not consistent and returns `$self` in case the status actually got changed, or a string (the current status) when there's no change.

I believe this is not correct and should be solved. If a warning about not being changed needs to be passed then it should use `->add_message`
Comment 1 Tomás Cohen Arazi (tcohen) 2025-08-22 11:35:59 UTC
I would like to add that the method itself does:

* log status changes
* deal with status_alias undefinition

This means those features will only be used if ->status is used exclusively when changing statuses. This means an author using:

```perl
$req->set( { status => 'NEW_STATUS', due_date => dt_from_string() } )->store();
```

won't get the expected results.

We need to either:

* Document statuses should never be done using ->set or ->update (including the resultset method)
* Move all this to the store() level

I also noticed the trick for nullifying the status_alias is also a consequence of how accessors are used in this module. This all needs a rethink.