Bug 27155

Summary: Include identifier test in Biblio_and_Items_plugin_hooks.t
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Test SuiteAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, kyle, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11
Bug Depends on:    
Bug Blocks: 27173    
Attachments: Bug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t
Bug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t

Description Marcel de Rooy 2020-12-04 15:15:36 UTC
The biblio and item hooks now look up a record which is deleted already. We could pass the deletedbiblio or deleteditem?
Especially on item deletion I am interested in receiving the biblionumber.

The code for items differs between 19.11 and master.
Comment 1 Jonathan Druart 2020-12-09 12:52:21 UTC
I am expecting the "deleted item" to be available with 'item'. Did you try to access $self->{item}->biblionumber?
Comment 2 Marcel de Rooy 2020-12-09 13:48:52 UTC
(In reply to Jonathan Druart from comment #1)
> I am expecting the "deleted item" to be available with 'item'. Did you try
> to access $self->{item}->biblionumber?

Probably a code change between 19.11 and master, as mentioned. In 19.11 the biblionumber was not available. Which at first glance still should be the case for biblio records..
Comment 3 Marcel de Rooy 2021-09-28 11:38:03 UTC
In the meantime the hooks moved to Koha::Item when refactoring.
And the biblionumber is now available.
So, thats probably fine.

Might adjust the test a bit still?
Comment 4 Marcel de Rooy 2021-09-28 11:55:25 UTC
Changing title and even component ;)
Comment 5 Marcel de Rooy 2021-09-28 11:57:11 UTC
Created attachment 125395 [details] [review]
Bug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t

The biblio and item action hooks pass a biblionumber or itemnumber now
to the plugin at time of deletion.
This patch adds a tiny refinement to Biblio_and_Items_plugin_hooks.t
and the associated test plugin to be sure of that.

Test plan:
Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Tomás Cohen Arazi 2021-09-28 12:14:31 UTC
Created attachment 125396 [details] [review]
Bug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t

The biblio and item action hooks pass a biblionumber or itemnumber now
to the plugin at time of deletion.
This patch adds a tiny refinement to Biblio_and_Items_plugin_hooks.t
and the associated test plugin to be sure of that.

Test plan:
Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi 2021-09-28 12:26:41 UTC
Straight QA. Trivial upgrade to tests I wrote.
Comment 8 Jonathan Druart 2021-09-29 10:44:08 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 9 Kyle M Hall 2021-10-08 13:29:07 UTC
Pushed to 21.05.x for 21.05.05
Comment 10 Fridolin Somers 2021-10-21 03:52:06 UTC
Pushed to 20.11.x for 20.11.11
Comment 11 Victor Grousset/tuxayo 2021-10-26 00:39:03 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.