From 2c347a2e917596016630fdb97804150dba76fc6b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 17 Jan 2014 03:04:26 +0000 Subject: [PATCH] Fix the dialplan delete atomic transaction. --- app/dialplan/dialplan_delete.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/dialplan/dialplan_delete.php b/app/dialplan/dialplan_delete.php index 667051ecb3..a22d81d9c0 100644 --- a/app/dialplan/dialplan_delete.php +++ b/app/dialplan/dialplan_delete.php @@ -44,11 +44,12 @@ else { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } -if (count($_GET)>0) { - $dialplan_uuid = check_str($_GET["id"]); -} +//set the dialplan uuid + if (count($_GET) > 0) { + $dialplan_uuid = check_str($_GET["id"]); + } -if (strlen($dialplan_uuid)>0) { +if (strlen($dialplan_uuid) > 0) { //get the dialplan data $sql = "select * from v_dialplans "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; @@ -64,7 +65,7 @@ if (strlen($dialplan_uuid)>0) { unset ($prep_statement); //start the atomic transaction - $count = $db->exec("BEGIN;"); + $db->beginTransaction(); //delete child data $sql = "delete from v_dialplan_details "; @@ -81,7 +82,7 @@ if (strlen($dialplan_uuid)>0) { unset($sql); //commit the atomic transaction - $count = $db->exec("COMMIT;"); + $db->commit(); //synchronize the xml config save_dialplan_xml();