Bugzilla – Attachment 53641 Details for
Bug 15451
Move the CSV related code to Koha::CsvProfile[s]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15451: Better error handling
Bug-15451-Better-error-handling.patch (text/plain), 2.94 KB, created by
Jonathan Druart
on 2016-07-22 09:28:28 UTC
(
hide
)
Description:
Bug 15451: Better error handling
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-07-22 09:28:28 UTC
Size:
2.94 KB
patch
obsolete
>From 0cb289ce1834d74cb4b56f2ab33e5db7b148ff82 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 Jul 2016 10:26:12 +0100 >Subject: [PATCH] Bug 15451: Better error handling > >1/ If a librarian edit (add_validate) a non-existing csv profile, we >explicitely die >2/ If you try to delete a non-existing csv profile, you will now get a >nice alert box >--- > .../prog/en/modules/tools/csv-profiles.tt | 22 +++++++++++++--------- > tools/csv-profiles.pl | 3 ++- > 2 files changed, 15 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >index 5fe6a91..46fc155 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >@@ -199,15 +199,19 @@ function reloadPage(p) { > > [% IF op == 'delete_confirm' %] > <div class="dialog alert"> >- <h3>Delete CSV Profile "[% csv_profile.profile %]?"</h3> >- <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post"> >- <input type="hidden" name="op" value="delete_confirmed" /> >- <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id %]" /> >- <input type="submit" class="approve" value="Yes, delete" /> >- </form> >- <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="get"> >- <input type="submit" class="deny" value="No, do not Delete" /> >- </form> >+ [% IF csv_profile %] >+ <h3>Delete CSV Profile "[% csv_profile.profile %]?"</h3> >+ <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post"> >+ <input type="hidden" name="op" value="delete_confirmed" /> >+ <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id %]" /> >+ <input type="submit" class="approve" value="Yes, delete" /> >+ </form> >+ <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="get"> >+ <input type="submit" class="deny" value="No, do not Delete" /> >+ </form> >+ [% ELSE %] >+ This CSV Profile does not exist. >+ [% END %] > </div> > [% END %] > >diff --git a/tools/csv-profiles.pl b/tools/csv-profiles.pl >index 7db0f67..a9b8525 100755 >--- a/tools/csv-profiles.pl >+++ b/tools/csv-profiles.pl >@@ -82,7 +82,8 @@ if ( $op eq 'add_form' ) { > my $encoding = $input->param("encoding"); > > if ($export_format_id) { >- my $csv_profile = Koha::CsvProfiles->find($export_format_id); >+ my $csv_profile = Koha::CsvProfiles->find($export_format_id) >+ or die "Something went wrong! This export_format_id does not match any existing CSV profile."; > $csv_profile->profile($profile); > $csv_profile->description($description); > $csv_profile->content($content); >-- >2.8.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 15451
:
46108
|
46109
|
46110
|
46111
|
46112
|
46113
|
46114
|
46306
|
50178
|
50179
|
50180
|
50181
|
50182
|
50183
|
50184
|
50185
|
50860
|
50861
|
50862
|
50863
|
50864
|
50865
|
50866
|
50867
|
50868
|
50985
|
53623
|
53624
|
53625
|
53626
|
53627
|
53628
|
53629
|
53630
|
53631
| 53641