Bugzilla – Attachment 174062 Details for
Bug 37365
Bad redirect when adding a patron message from members/files.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37365: (QA follow-up) Add error checking around AddFile call
Bug-37365-QA-follow-up-Add-error-checking-around-A.patch (text/plain), 2.35 KB, created by
Aleisha Amohia
on 2024-11-06 03:19:29 UTC
(
hide
)
Description:
Bug 37365: (QA follow-up) Add error checking around AddFile call
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-11-06 03:19:29 UTC
Size:
2.35 KB
patch
obsolete
>From 1dd910a3e6b38cfa278974c969e14ba6ab94dfe7 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 4 Oct 2024 09:11:47 +0000 >Subject: [PATCH] Bug 37365: (QA follow-up) Add error checking around AddFile > call > >Test plan: >Add a return; in AddFile to simulate a failing db insert. >Verify that an alert pops up. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt | 1 + > members/files.pl | 7 +++---- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt >index 1abba948ab8..f60554a4b67 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt >@@ -47,6 +47,7 @@ > <div class="alert alert-warning"> > [% IF errors.empty_upload %]The file you are attempting to upload has no contents.[% END %] > [% IF errors.no_file %]You did not select a file to upload.[% END %] >+ [% IF errors.upload_failed %]The upload failed. More information may be in the system logs.[% END %] > </div> > [% END %] > >diff --git a/members/files.pl b/members/files.pl >index c09658a2d2a..e60a9a7d2a3 100755 >--- a/members/files.pl >+++ b/members/files.pl >@@ -87,12 +87,13 @@ else { > $file_content .= $_; > } > >- $bf->AddFile( >+ my $rv = $bf->AddFile( > name => $filename, > type => $mimetype, > content => $file_content, > description => scalar $cgi->param('description'), > ); >+ $errors{upload_failed} = 1 unless $rv; > } > } > else { >@@ -103,9 +104,7 @@ else { > } > > $template->param( >- files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) >- ->GetFilesInfo(), >- >+ files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )->GetFilesInfo(), > errors => \%errors, > ); > output_html_with_http_headers $cgi, $cookie, $template->output; >-- >2.39.5
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 37365
:
169028
|
169034
|
172381
|
172382
|
174061
| 174062