Bugzilla – Attachment 122474 Details for
Bug 20310
Article requests: Use details from the host record when submitting an article request on an analytic record without attached items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20310: (follow-up) Move syspref check into controller
Bug-20310-follow-up-Move-syspref-check-into-contro.patch (text/plain), 2.91 KB, created by
Martin Renvoize (ashimema)
on 2021-06-28 13:10:28 UTC
(
hide
)
Description:
Bug 20310: (follow-up) Move syspref check into controller
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-06-28 13:10:28 UTC
Size:
2.91 KB
patch
obsolete
>From 01ede04054efa9a7dc08d8b08881984a92b1649b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 28 Jun 2021 14:07:53 +0100 >Subject: [PATCH] Bug 20310: (follow-up) Move syspref check into controller > >I believe the syspref check is better placed in the controller. This way >the host_record method is not so closely tied to the articel requests >feature and may subsequently prove useful to future use cases. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Biblio.pm | 1 - > opac/opac-request-article.pl | 21 +++++++++++++-------- > t/db_dependent/Koha/Biblio/host_record.t | 1 - > 3 files changed, 13 insertions(+), 10 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 12b22d90ef..3b38a82ce0 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -910,7 +910,6 @@ sub host_record { > my ($self, $params) = @_; > my $no_items = $params->{no_items}; > return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO >- return if !C4::Context->preference('ArticleRequestsHostRedirection'); > return if $params->{no_items} && $self->items->count > 0; > > my $record; >diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl >index eb50d8f0da..6da39f8c8e 100755 >--- a/opac/opac-request-article.pl >+++ b/opac/opac-request-article.pl >@@ -77,14 +77,19 @@ if ( $action eq 'create' ) { > > print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests"); > exit; >-} elsif ( !$action ) { >- # Should we redirect? >- # Conditions: no items, host item entry (MARC21 773) >- my ( $host, $pageinfo ) = $biblio->host_record({ no_items => 1 }); >- if( $host ) { >- $template->param( pageinfo => $pageinfo, title => $biblio->title, author => $biblio->author ); >- $biblio = $host; >- } >+# Should we redirect? >+} >+elsif ( !$action && C4::Context->preference('ArticleRequestsHostRedirection') ) { >+ # Conditions: no items, host item entry (MARC21 773) >+ my ( $host, $pageinfo ) = $biblio->host_record( { no_items => 1 } ); >+ if ($host) { >+ $template->param( >+ pageinfo => $pageinfo, >+ title => $biblio->title, >+ author => $biblio->author >+ ); >+ $biblio = $host; >+ } > } > > my $patron = Koha::Patrons->find($borrowernumber); >diff --git a/t/db_dependent/Koha/Biblio/host_record.t b/t/db_dependent/Koha/Biblio/host_record.t >index bf728f1d38..59b9f139e6 100755 >--- a/t/db_dependent/Koha/Biblio/host_record.t >+++ b/t/db_dependent/Koha/Biblio/host_record.t >@@ -40,7 +40,6 @@ subtest 'host_record' => sub { > > t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); > t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' ); >- t::lib::Mocks::mock_preference( 'ArticleRequestsHostRedirection', 1 ); > > my $bib1 = $builder->build_object({ class => 'Koha::Biblios' }); > my $bib2 = $builder->build_object({ class => 'Koha::Biblios' }); >-- >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 20310
:
73142
|
73143
|
73805
|
73998
|
74000
|
74992
|
74993
|
74994
|
88887
|
88888
|
88889
|
109750
|
109751
|
109752
|
109753
|
111467
|
111468
|
111469
|
111470
|
118976
|
118977
|
118978
|
118979
|
119346
|
122469
|
122470
|
122471
|
122472
|
122473
|
122474
|
122475
|
122725
|
122726
|
122727
|
122728
|
122729
|
122730
|
122731
|
122732