Bug 33837 - Objects->filter_by_last_update: Does not allow time comparison
Summary: Objects->filter_by_last_update: Does not allow time comparison
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 33843
  Show dependency treegraph
 
Reported: 2023-05-25 13:55 UTC by Marcel de Rooy
Modified: 2023-05-26 08:22 UTC (History)
0 users

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


Attachments
Bug 33837: Add datetime comparison to filter_by_last_update (2.73 KB, patch)
2023-05-26 07:56 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33837: Add unit test (1.74 KB, patch)
2023-05-26 07:56 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33837: filter_by_last_update: Add older_than and younger_than (4.62 KB, patch)
2023-05-26 07:56 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33837: Replace days_inclusive by min_days (6.22 KB, patch)
2023-05-26 07:56 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2023-05-25 13:55:51 UTC

    
Comment 1 Marcel de Rooy 2023-05-26 07:56:35 UTC
Created attachment 151720 [details] [review]
Bug 33837: Add datetime comparison to filter_by_last_update

Test plan:
Verify that filter_by_last_update still works as expected by
running cleanup_database.pl with --messages DAYS parameter.
Look at the oldest messages.message_date (or insert one).
Run with -days X where today - X is before that date.
Run with -days Y where today - Y is just after it.

Note: misc/cronjobs/cleanup_database.pl -confirm -messages -1 -v
will remove all messages including one you inserted just now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-05-26 07:56:37 UTC
Created attachment 151721 [details] [review]
Bug 33837: Add unit test

Test plan:
Run t/db_dependent/Koha/Objects.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2023-05-26 07:56:39 UTC
Created attachment 151722 [details] [review]
Bug 33837: filter_by_last_update: Add older_than and younger_than

Test plan:
Run t/db_dependent/Koha/Objects.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2023-05-26 07:56:41 UTC
Created attachment 151723 [details] [review]
Bug 33837: Replace days_inclusive by min_days

Instead of passing days and days_inclusive, this patch adds
min_days as replacement. Since days_inclusive is not widely
used, this can be done easily. It removes the confusion
whether days_inclusive impacted other parameters or not.

Test plan:
Run t/db_dependent/Koha/Objects.t
Run t/db_dependent/Koha/Old/Checkouts.t
Run t/db_dependent/Koha/Patrons.t (verifying the change in the
Koha::Patrons module for filtering by expiration date).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>