Bug 21765 - AutoUnsuspendReserves manually sets holds fields instead of calling ->resume
Summary: AutoUnsuspendReserves manually sets holds fields instead of calling ->resume
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Target Milestone: ---
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-05 14:44 UTC by George Williams (NEKLS)
Modified: 2019-02-11 20:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 21765: Regression tests (5.78 KB, patch)
2019-02-11 19:09 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume (1.40 KB, patch)
2019-02-11 19:10 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21765: Regression tests (5.85 KB, patch)
2019-02-11 20:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume (1.47 KB, patch)
2019-02-11 20:04 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description George Williams (NEKLS) 2018-11-05 14:44:47 UTC
When HoldsLog is set to "Log," holds that are manually unsuspended by staff or patrons are logged in action_logs, but holds unsuspended by auto_unsuspend_holds.pl are not.
Comment 1 Tomás Cohen Arazi 2019-02-11 17:32:23 UTC
This has the side-effect of having holds resuming by the auto_unsuspend_holds.pl script not logging.
Comment 2 Tomás Cohen Arazi 2019-02-11 19:09:50 UTC
Created attachment 84999 [details] [review]
Bug 21765: Regression tests
Comment 3 Tomás Cohen Arazi 2019-02-11 19:10:03 UTC
Created attachment 85000 [details] [review]
Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume

This patch makes the mentioned method use the biult-in method for
resuming a suspended hold, instead of manually setting the specific
attributes using the accessors.

The side effect for this is that HoldsLog is now honoured.

This patchset also refactors the tests a bit so they rely on the exposed
methods and thus don't rely on specific implementation details (like
suspended hold means a date in suspended_until plus suspended=1).

To test:
- Apply the regression tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t
=> FAIL: It fails loudly because things are done manually
- Apply this patch
- Run:
 k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t
=> SUCCESS: Tests pass!
Comment 4 Kyle M Hall 2019-02-11 20:04:28 UTC
Created attachment 85007 [details] [review]
Bug 21765: Regression tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall 2019-02-11 20:04:39 UTC
Created attachment 85008 [details] [review]
Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume

This patch makes the mentioned method use the biult-in method for
resuming a suspended hold, instead of manually setting the specific
attributes using the accessors.

The side effect for this is that HoldsLog is now honoured.

This patchset also refactors the tests a bit so they rely on the exposed
methods and thus don't rely on specific implementation details (like
suspended hold means a date in suspended_until plus suspended=1).

To test:
- Apply the regression tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t
=> FAIL: It fails loudly because things are done manually
- Apply this patch
- Run:
 k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t
=> SUCCESS: Tests pass!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>