Bug 21765 - AutoUnsuspendReserves manually sets holds fields instead of calling ->resume
Summary: AutoUnsuspendReserves manually sets holds fields instead of calling ->resume
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Josef Moravec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-05 14:44 UTC by George Williams (NEKLS)
Modified: 2019-05-27 12:31 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


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
Bug 21765: Regression tests (5.89 KB, patch)
2019-02-20 16:43 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume (1.50 KB, patch)
2019-02-20 16:43 UTC, Josef Moravec
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>
Comment 6 Josef Moravec 2019-02-20 16:43:14 UTC
Created attachment 85386 [details] [review]
Bug 21765: Regression tests

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2019-02-20 16:43:18 UTC
Created attachment 85387 [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>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Nick Clemens 2019-02-27 14:16:36 UTC
Awesome work all!

Pushed to master for 19.05
Comment 9 Martin Renvoize 2019-03-01 11:35:34 UTC
Pushed to 18.11.x for 18.11.04 - I considered the lack of an action log in this case a bug the overriding factor here and so switch back from 'enhancement' to 'bug'.
Comment 10 Jesse Maseto 2019-03-08 19:18:20 UTC
Pushed to 18.05.x for 18.05.11