Bugzilla – Attachment 118560 Details for
Bug 28010
add plugin to modify record in "opac-detail.pl"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to opac-detail.pl
opac-detail-record.patch (text/plain), 1.67 KB, created by
Mark Hofstetter
on 2021-03-20 21:21:35 UTC
(
hide
)
Description:
patch to opac-detail.pl
Filename:
MIME Type:
Creator:
Mark Hofstetter
Created:
2021-03-20 21:21:35 UTC
Size:
1.67 KB
patch
obsolete
>diff --git a/Plugins.pm.orig b/Plugins.pm >index 11d44dc..71461de 100644 >--- a/Plugins.pm.orig >+++ b/Plugins.pm >@@ -82,6 +82,35 @@ sub call { > return @responses; > } > >+=head2 call_apply >+ >+Calls a plugin method for all enabled plugins, reworking on the same input and returning it. >+ideally the caller of a plugin must not know how to merge the results >+so maybe also implement a "merge" method in the plugin >+ >+ @responses = Koha::Plugins->call_apply($method, $work_var, @args) >+ >+=cut >+ >+sub call_apply { >+ my ($class, $method, $work_var, @args) = @_; >+ >+ if (C4::Context->config('enable_plugins')) { >+ my @plugins = $class->new({ enable_plugins => 1 })->GetPlugins({ method => $method }); >+ @plugins = grep { $_->can($method) } @plugins; >+ foreach my $plugin (@plugins) { >+ my $work_var = eval { $plugin->$method($work_var, @args) }; >+ if ($@) { >+ warn sprintf("Plugin error (%s): %s", $plugin->get_metadata->{name}, $@); >+ next; >+ } >+ } >+ >+ } >+ return $work_var; >+} >+ >+ > > =head2 GetPlugins > >diff --git a/opac-detail.pl.orig b/opac-detail.pl >index e74cf4b..b46eb90 100755 >--- a/opac-detail.pl.orig >+++ b/opac-detail.pl >@@ -217,6 +217,16 @@ if ( $xslfile ) { > $variables = { %$variables, %$plugin_variables }; > } > >+ $record = Koha::Plugins->call_apply( >+ 'munge_record', >+ $record, >+ { >+ patron => $patron, >+ interface => 'opac', >+ caller => 'opac-detail', >+ } >+ ); >+ > $template->param( > XSLTBloc => XSLTParse4Display( > $biblionumber, $record, "OPACXSLTDetailsDisplay", 1, undef,
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 28010
: 118560