Bugzilla – Attachment 124892 Details for
Bug 27859
MARC export for search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Use patron object instead of userenv
Use-patron-object-instead-of-userenv.patch (text/plain), 1.96 KB, created by
David Gustafsson
on 2021-09-15 14:14:18 UTC
(
hide
)
Description:
Use patron object instead of userenv
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2021-09-15 14:14:18 UTC
Size:
1.96 KB
patch
obsolete
>From 3a03d7d777fc79528fbd6a491fec53d24d3647b3 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >Date: Wed, 21 Jul 2021 16:32:36 +0200 >Subject: [PATCH] Use patron object instead of userenv > >https://bugs.koha-community.org/show_bug.cgi?id=27859 >--- > catalogue/search.pl | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index fb565a9dd9..f9fba25bf3 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -550,23 +550,20 @@ my $export_user_email = undef; > > if ($template_name eq 'catalogue/results.tt' && $export && $preferred_format && C4::Context->preference('SearchEngine') eq 'Elasticsearch') { > >- my $uid; >- my $userenv = C4::Context->userenv; >- if ($userenv) { >- $uid = $userenv->{number}; >- if ($userenv->{emailaddress}) { >- $export_user_email = $userenv->{emailaddress}; >+ my $patron = Koha::Patrons->find( $borrowernumber ); >+ >+ if ($patron) { >+ if ($patron->email) { >+ $export_user_email = $patron->email; > } > else { > die "Unable to fetch user email"; > } > } > else { >- die "Unable to fetch userenv"; >+ die "Unable to fetch user"; > } > >- my $patron = Koha::Patrons->find( $borrowernumber ); >- > if (!($patron && $patron->has_permission({ tools => 'export_catalog' }))) { > die "Missing permission \"export_catalog\" required for exporting search results"; > } >@@ -647,7 +644,7 @@ if ($template_name eq 'catalogue/results.tt' && $export && $preferred_format && > filename => $filename, > dir => $category, > filesize => $size, >- owner => $uid, >+ owner => $borrowernumber, > uploadcategorycode => 'search_marc_export', > public => 0, > permanent => 1, >-- >2.20.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 27859
:
117718
|
117721
|
124892
|
124893
|
128632
|
131442
|
131443
|
132993
|
132997
|
133076
|
145243
|
145244
|
145263
|
145300
|
147927
|
147935
|
147936
|
162342
|
162343
|
163761
|
163762