Bugzilla – Attachment 4321 Details for
Bug 6436
Don't allow deletion of an itemtype used in items.itype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed-off patch
0001-SIGNED-OFF-BUG6436-Don-t-allow-deletion-of-an-itemty.patch (text/plain), 1.45 KB, created by
Owen Leonard
on 2011-05-31 20:16:04 UTC
(
hide
)
Description:
Signed-off patch
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2011-05-31 20:16:04 UTC
Size:
1.45 KB
patch
obsolete
>From 250276c89f5dfc4b6d926a2c1826d3776e7e6f35 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@progilone.fr> >Date: Tue, 31 May 2011 15:16:15 +0200 >Subject: [PATCH] [SIGNED-OFF] BUG6436 Don't allow deletion of an itemtype used in items.itype >Content-Type: text/plain; charset="utf-8" > > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > admin/itemtypes.pl | 20 +++++++++++--------- > 1 files changed, 11 insertions(+), 9 deletions(-) > >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 1a33a21..3219da3 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -188,15 +188,17 @@ elsif ( $op eq 'add_validate' ) { > # called by default form, used to confirm deletion of data in DB > } > elsif ( $op eq 'delete_confirm' ) { >- # Check both categoryitem and biblioitems, see Bug 199 >- my $total = 0; >- for my $table ('biblioitems') { >- my $sth = >- $dbh->prepare( >- "select count(*) as total from $table where itemtype=?"); >- $sth->execute($itemtype); >- $total += $sth->fetchrow_hashref->{total}; >- } >+ # Check both items and biblioitems >+ my $sth = $dbh->prepare(' >+ SELECT COUNT(*) AS total FROM ( >+ SELECT itemtype AS t FROM biblioitems >+ UNION >+ SELECT itype AS t FROM items >+ ) AS tmp >+ WHERE tmp.t=? >+ '); >+ $sth->execute($itemtype); >+ my $total = $sth->fetchrow_hashref->{'total'}; > > my $sth = > $dbh->prepare( >-- >1.7.3 >
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 6436
:
4319
| 4321