Bug 10855: (follow-up) Bug 10855: Remove additional field values when subscription...
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 Sep 2015 14:38:44 +0000 (15:38 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 2 Oct 2015 18:10:31 +0000 (15:10 -0300)
The subscriptionid should not be escaped and placeholders used.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Serials.pm

index 6c97c5f..a157460 100644 (file)
@@ -1839,10 +1839,9 @@ this function deletes subscription which has $subscriptionid as id.
 sub DelSubscription {
     my ($subscriptionid) = @_;
     my $dbh = C4::Context->dbh;
-    $subscriptionid = $dbh->quote($subscriptionid);
-    $dbh->do("DELETE FROM subscription WHERE subscriptionid=$subscriptionid");
-    $dbh->do("DELETE FROM subscriptionhistory WHERE subscriptionid=$subscriptionid");
-    $dbh->do("DELETE FROM serial WHERE subscriptionid=$subscriptionid");
+    $dbh->do("DELETE FROM subscription WHERE subscriptionid=?", undef, $subscriptionid);
+    $dbh->do("DELETE FROM subscriptionhistory WHERE subscriptionid=?", undef, $subscriptionid);
+    $dbh->do("DELETE FROM serial WHERE subscriptionid=?", undef, $subscriptionid);
 
     my $afs = Koha::AdditionalField->all({tablename => 'subscription'});
     foreach my $af (@$afs) {