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.
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
Created attachment 151434 [details] Simple plugin to test the patch
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>
Test plan works as described, thanks for the patch.
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 %]
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
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
patch rebased
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.