Bugzilla – Attachment 178342 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), 3.83 KB, created by
Hammat wele
on 2025-02-19 14:32:05 UTC
(
hide
)
Description:
Bug 33758 - Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-02-19 14:32:05 UTC
Size:
3.83 KB
patch
obsolete
>From 8496ef38f9f44d6f5c90fe14107892a6d3bb040c 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 | 5 +---- > t/lib/plugins/Koha/Plugin/Test.pm | 5 +++-- > 3 files changed, 5 insertions(+), 7 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 2b033e40f6..a4d37ab4b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -307,7 +307,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 c8b8163b37..ad786eb52b 100755 >--- a/t/db_dependent/Koha/Plugins/Plugins.t >+++ b/t/db_dependent/Koha/Plugins/Plugins.t >@@ -266,10 +266,7 @@ subtest 'Koha::Plugin::Test' => sub { > 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('before_send_messages'), 'Test plugin can before_send_messages' ); >diff --git a/t/lib/plugins/Koha/Plugin/Test.pm b/t/lib/plugins/Koha/Plugin/Test.pm >index 970c4ec7b6..f7ba3a65c9 100644 >--- a/t/lib/plugins/Koha/Plugin/Test.pm >+++ b/t/lib/plugins/Koha/Plugin/Test.pm >@@ -53,8 +53,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
|
178342
|
178354
|
178355