Bugzilla – Attachment 91538 Details for
Bug 23319
Reloading page when adding to basket from existing order can cause internal server error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Implement blocking errors for neworderbiblio and basket.pl
Implement-blocking-errors-for-neworderbiblio-and-b.patch (text/plain), 4.76 KB, created by
Nick Clemens (kidclamp)
on 2019-07-15 17:52:22 UTC
(
hide
)
Description:
Implement blocking errors for neworderbiblio and basket.pl
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-07-15 17:52:22 UTC
Size:
4.76 KB
patch
obsolete
>From 509c2395a83a5274d2593353422067cd171ac94c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 15 Jul 2019 17:46:36 +0000 >Subject: [PATCH] Implement blocking errors for neworderbiblio and basket.pl > >To test: >1 - Hit neworderbiblio with a query and no vendor > http://localhost:8081/cgi-bin/koha/acqui/neworderbiblio.pl?q=cat > Or, add to basket from existing record with a search > Refresh the page (url has no parameters) >2 - Get an internal server error >3 - Add bookseller > http://localhost:8081/cgi-bin/koha/acqui/neworderbiblio.pl?q=cat&booksellerid=1 >4 - Click 'Order' on a result >5 - Internal server error >6 - Apply patch >7 - Repeat 1-4, you get 'Vendor not found' or 'Basket not found' > >https://bugs.koha-community.org/show_bug.cgi?id=23319 >--- > acqui/neworderbiblio.pl | 2 ++ > acqui/neworderempty.pl | 3 +++ > koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc | 2 ++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt | 2 ++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 2 ++ > 5 files changed, 11 insertions(+) > >diff --git a/acqui/neworderbiblio.pl b/acqui/neworderbiblio.pl >index b48737d79f..d15b11d294 100755 >--- a/acqui/neworderbiblio.pl >+++ b/acqui/neworderbiblio.pl >@@ -97,6 +97,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+output_and_exit( $input, $cookie, $template, 'unknown_vendor') unless $bookseller; >+ > # Searching the catalog. > > my @operands = $query; >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 9ca2b5b05a..d6efffcee5 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -138,6 +138,9 @@ my $basketobj = Koha::Acquisition::Baskets->find( $basketno ); > $booksellerid = $basket->{booksellerid} unless $booksellerid; > my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); > >+output_and_exit( $input, $cookie, $template, 'unknown_basket') unless $basketobj; >+output_and_exit( $input, $cookie, $template, 'unknown_vendor') unless $bookseller; >+ > my $contract = GetContract({ > contractnumber => $basket->{contractnumber} > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc >index 68eb5543c1..8db6e956db 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc >@@ -11,6 +11,8 @@ > <div class="dialog message">Subscription not found.</div> > [% CASE 'unknown_basket' %] > <div class="dialog message">Basket not found.</div> >+ [% CASE 'unknown_vendor' %] >+ <div class="dialog message">Vendor not found.</div> > [% CASE 'wrong_csrf_token' %] > <div class="dialog message">The form submission failed (Wrong CSRF token). Try to come back, refresh the page, then try again.</div> > [% CASE %][% blocking_error | html %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt >index 482185b33e..e9fbc367b8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt >@@ -12,6 +12,8 @@ > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Basket [% basketno | html %]</a> › Search existing records</div> > >+[% INCLUDE 'blocking_errors.inc' %] >+ > <div class="main container-fluid"> > <div class="row"> > <div class="col-sm-10 col-sm-push-2"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index ff0113f563..df96f1a52e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -17,6 +17,8 @@ > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Basket [% basketno | html %]</a> › [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber | html %])[% ELSE %]New order[% END %]</div> > >+[% INCLUDE 'blocking_errors.inc' %] >+ > <div class="main container-fluid"> > <div class="row"> > <div class="col-sm-10 col-sm-push-2"> >-- >2.11.0
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 23319
:
91538
|
91675
|
92126