Bugzilla – Attachment 158160 Details for
Bug 33758
Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Bug-33758---Add-a-parameter-to-use-the-intranetcat.patch (text/plain), 4.08 KB, created by
Emily-Rose Francoeur
on 2023-10-31 20:24:29 UTC
(
hide
)
Description:
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Filename:
MIME Type:
Creator:
Emily-Rose Francoeur
Created:
2023-10-31 20:24:29 UTC
Size:
4.08 KB
patch
obsolete
>From 6f873d701f26ea7e7a065970e30b85f06bddc00b Mon Sep 17 00:00:00 2001 >From: Emily-Rose Francoeur <emily-rose.francoeur@inLibro.com> >Date: Tue, 31 Oct 2023 15:48:42 -0400 >Subject: [PATCH] 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 >--- > koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- > t/db_dependent/Koha/Plugins/Plugins.t | 3 ++- > t/lib/plugins/Koha/Plugin/Test.pm | 5 +++-- > 3 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 03bcb38059..d8dd28b83d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -207,7 +207,7 @@ > [% END %] > > [% FOREACH p IN plugins %] >- [% p.intranet_catalog_biblio_enhancements_toolbar_button | $raw %] >+ [% p.intranet_catalog_biblio_enhancements_toolbar_button({ biblionumber => biblionumber }) | $raw %] > [% END %] > > </div> >diff --git a/t/db_dependent/Koha/Plugins/Plugins.t b/t/db_dependent/Koha/Plugins/Plugins.t >index a629bf0123..902599cf2b 100755 >--- a/t/db_dependent/Koha/Plugins/Plugins.t >+++ b/t/db_dependent/Koha/Plugins/Plugins.t >@@ -249,6 +249,7 @@ $mock_plugin->mock( 'test_template', sub { > ok( can_load( modules => { "Koha::Plugin::Test" => undef } ), 'Test can_load' ); > > my $plugin = Koha::Plugin::Test->new({ enable_plugins => 1, cgi => CGI->new }); >+my $biblionumber = 1; > > isa_ok( $plugin, "Koha::Plugin::Test", 'Test plugin class' ); > isa_ok( $plugin, "Koha::Plugins::Base", 'Test plugin parent class' ); >@@ -257,7 +258,7 @@ ok( $plugin->can('report'), 'Test plugin can report' ); > ok( $plugin->can('tool'), 'Test plugin can tool' ); > ok( $plugin->can('to_marc'), 'Test plugin can to_marc' ); > ok( $plugin->can('intranet_catalog_biblio_enhancements'), 'Test plugin can intranet_catalog_biblio_enhancements'); >-ok( $plugin->can('intranet_catalog_biblio_enhancements_toolbar_button'), 'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button' ); >+is( $plugin->intranet_catalog_biblio_enhancements_toolbar_button({ biblionumber => $biblionumber }), $biblionumber, 'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button with biblionumber parameter'); > ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' ); > ok( $plugin->can('after_hold_create'), 'Test plugin can after_hold_create' ); > ok( $plugin->can('opac_online_payment_begin'), 'Test plugin can opac_online_payment_begin' ); >diff --git a/t/lib/plugins/Koha/Plugin/Test.pm b/t/lib/plugins/Koha/Plugin/Test.pm >index 6744a7e7f3..eac890cb2c 100644 >--- a/t/lib/plugins/Koha/Plugin/Test.pm >+++ b/t/lib/plugins/Koha/Plugin/Test.pm >@@ -50,8 +50,9 @@ sub to_marc { > } > > sub intranet_catalog_biblio_enhancements_toolbar_button { >- my ( $self, $args ) = @_; >- return "Koha::Plugin::Test::intranet_catalog_biblio_enhancements_toolbar_button"; >+ my ( $self, $params ) = @_; >+ my $biblionumber = $params->{biblionumber}; >+ return $biblionumber; > } > > sub intranet_catalog_biblio_enhancements { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33758
:
151426
|
151434
|
151473
|
158160
|
163798