Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Summary: Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_butto...
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nicolas Giraud
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-17 20:48 UTC by Nicolas Giraud
Modified: 2025-01-28 18:26 UTC (History)
9 users (show)

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


Attachments
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook (3.38 KB, patch)
2023-05-18 15:35 UTC, Nicolas Giraud
Details | Diff | Splinter Review
Simple plugin to test the patch (1.21 KB, application/zip)
2023-05-18 18:05 UTC, Nicolas Giraud
Details
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook (3.44 KB, patch)
2023-05-19 12:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook (4.08 KB, patch)
2023-10-31 20:24 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook (3.72 KB, patch)
2024-03-25 12:34 UTC, Hammat wele
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Giraud 2023-05-17 20:48:18 UTC
I have one plugin who have to know the biblionumber to add a custom button in the toolbar in the page details.pl

But currently, the method is called without parameter so the plugin doesn't know in which biblionumber details page it adds the new button.  

The parameter allows to create custom with the biblionumber link to the button.
Comment 1 Nicolas Giraud 2023-05-18 15:35:25 UTC
Created attachment 151426 [details] [review]
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook

This patch adds a parameter to call the method intranet_catalog_biblio_enhancements_toolbar_button with a biblionumber in the page catalogue/detail.pl.

Modification of cat-toolbar.inc to display new buttons correctly.

To test :
1. Apply the patch
2. Take a plugin who implements the method intranet_catalog_biblio_enhancements_toolbar_button
3. Check if the parameter "biblionumber" is passed correctly at this method
4. Create the new button in HTML in the plugin method
(button must be like the ones that are in the toolbar of the page detail.pl)
5. Go to the page in browser and check if the new button is displayed
Comment 2 Nicolas Giraud 2023-05-18 18:05:57 UTC
Created attachment 151434 [details]
Simple plugin to test the patch
Comment 3 ByWater Sandboxes 2023-05-19 12:13:09 UTC
Created attachment 151473 [details] [review]
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook

This patch adds a parameter to call the method intranet_catalog_biblio_enhancements_toolbar_button with a biblionumber in the page catalogue/detail.pl.

Modification of cat-toolbar.inc to display new buttons correctly.

To test :
1. Apply the patch
2. Take a plugin who implements the method intranet_catalog_biblio_enhancements_toolbar_button
3. Check if the parameter "biblionumber" is passed correctly at this method
4. Create the new button in HTML in the plugin method
(button must be like the ones that are in the toolbar of the page detail.pl)
5. Go to the page in browser and check if the new button is displayed

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 4 Sally 2023-05-19 12:13:34 UTC
Test plan works as described, thanks for the patch.
Comment 5 Kyle M Hall (khall) 2023-07-14 17:55:11 UTC
Couple of thing:
* Please update the unit tests
* Couldn't you just modify the template and pass the biblionumber from there? It seems much simpler as a solution:
[% p.intranet_catalog_biblio_enhancements_toolbar_button | $raw %]
becomes
[% p.intranet_catalog_biblio_enhancements_toolbar_button(biblionumber) | $raw %]
Comment 6 Emily-Rose Francoeur 2023-10-31 20:24:29 UTC
Created attachment 158160 [details] [review]
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook

This patch calls the method "intranet_catalog_biblio_enhancements_toolbar_button" with the parameter "biblionumber" in "cat-toolbar.inc".
I also updated the unit tests.

A plugin is in the attachments to help you test the patch. When the patch is applied, the plugin displays a button with the text "Test - [biblionumber]" in the catalogue/detail.pl toolbar.

To test:
1. Apply the patch
2. Use a plugin that implements the "intranet_catalog_biblio_enhancements_toolbar_button method" (you can use the plugin in the attachments)
3. Check if the parameter "biblionumber" is passed correctly to this
   method
4. Create the new button in the plugin method
(button must be like the ones that are in the toolbar of the page catalogue/detail.pl)
5. In a browser, go to the detail page of a record (catalogue/detail.pl)
6. Check if the new button is displayed
7. In a terminal, run the unit tests (prove ./t/db_dependent/Koha/Plugins/Plugins.t)
8. Check that all the tests passed
Comment 7 Hammat wele 2024-03-25 12:34:29 UTC
Created attachment 163798 [details] [review]
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook

This patch calls the method "intranet_catalog_biblio_enhancements_toolbar_button" with the parameter "biblionumber" in "cat-toolbar.inc".
I also updated the unit tests.

A plugin is in the attachments to help you test the patch. When the patch is applied, the plugin displays a button with the text "Test - [biblionumber]" in the catalogue/detail.pl toolbar.

To test:
1. Apply the patch
2. Use a plugin that implements the "intranet_catalog_biblio_enhancements_toolbar_button method" (you can use the plugin in the attachments)
3. Check if the parameter "biblionumber" is passed correctly to this
   method
4. Create the new button in the plugin method
(button must be like the ones that are in the toolbar of the page catalogue/detail.pl)
5. In a browser, go to the detail page of a record (catalogue/detail.pl)
6. Check if the new button is displayed
7. In a terminal, run the unit tests (prove ./t/db_dependent/Koha/Plugins/Plugins.t)
8. Check that all the tests passed
Comment 8 Hammat wele 2024-03-25 12:35:15 UTC
patch rebased
Comment 9 Lucas Gass (lukeg) 2025-01-28 18:26:36 UTC
Some QA tool failures:

 FAIL	t/db_dependent/Koha/Plugins/Plugins.t
   FAIL	  valid
		Global symbol "$biblionumber" requires explicit package name (did you forget to declare "my $biblionumber"?)
		Global symbol "$biblionumber" requires explicit package name (did you forget to declare "my $biblionumber"?)
		Type of arg 1 to Test::Warn::warnings_like must be block or sub {} (not reference constructor)
		Type of arg 1 to Test::Warn::warnings_like must be block or sub {} (not reference constructor)
		t/db_dependent/Koha/Plugins/Plugins.t had compilation errors.