Bugzilla – Attachment 87235 Details for
Bug 22575
Item type administration uses invalid error class for dialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22575: Item type administration uses invalid error class for dialog
Bug-22575-Item-type-administration-uses-invalid-er.patch (text/plain), 2.77 KB, created by
Bin Wen
on 2019-03-29 19:48:27 UTC
(
hide
)
Description:
Bug 22575: Item type administration uses invalid error class for dialog
Filename:
MIME Type:
Creator:
Bin Wen
Created:
2019-03-29 19:48:27 UTC
Size:
2.77 KB
patch
obsolete
>From 5d18a398d4392842e9240220f74fbaa7009a989d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 26 Mar 2019 14:11:28 +0000 >Subject: [PATCH] Bug 22575: Item type administration uses invalid error class > for dialog > >This patch modifies the item types administration script so that it >passes a valid message type to the template, where the type is used as a >CSS class. "Error" is a nonexistent dialog class. It should be "alert." > >To test, apply the patch and go to Administration -> Item types. > > - Try to delete an item type which is in use. The style of the error > dialog should be correct. > - Try to add an item type using a code which already exists. The error > should look correct. > >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> >Signed-off-by: Bin Wen <bin.wen@inlibro.com> >--- > admin/itemtypes.pl | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 441bd0514a..48ddbfaef1 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -110,7 +110,7 @@ if ( $op eq 'add_form' ) { > eval { $itemtype->store; }; > > if ($@) { >- push @messages, { type => 'error', code => 'error_on_update' }; >+ push @messages, { type => 'alert', code => 'error_on_update' }; > } else { > push @messages, { type => 'message', code => 'success_on_update' }; > } >@@ -137,13 +137,13 @@ if ( $op eq 'add_form' ) { > eval { $itemtype->store; }; > > if ($@) { >- push @messages, { type => 'error', code => 'error_on_insert' }; >+ push @messages, { type => 'alert', code => 'error_on_insert' }; > } else { > push @messages, { type => 'message', code => 'success_on_insert' }; > } > } else { > push @messages, >- { type => 'error', >+ { type => 'alert', > code => 'already_exists', > }; > } >@@ -155,7 +155,7 @@ if ( $op eq 'add_form' ) { > my $itemtype = Koha::ItemTypes->find($itemtype_code); > my $can_be_deleted = $itemtype->can_be_deleted(); > if ($can_be_deleted == 0) { >- push @messages, { type => 'error', code => 'cannot_be_deleted'}; >+ push @messages, { type => 'alert', code => 'cannot_be_deleted'}; > $op = 'list'; > } else { > $template->param( itemtype => $itemtype, ); >@@ -166,7 +166,7 @@ if ( $op eq 'add_form' ) { > my $itemtype = Koha::ItemTypes->find($itemtype_code); > my $deleted = eval { $itemtype->delete }; > if ( $@ or not $deleted ) { >- push @messages, { type => 'error', code => 'error_on_delete' }; >+ push @messages, { type => 'alert', code => 'error_on_delete' }; > } else { > push @messages, { type => 'message', code => 'success_on_delete' }; > } >-- >2.17.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 22575
:
87018
|
87234
|
87235
|
87243