From 06898167720158604f1c3d1d2e19a591208c607a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 20 May 2015 19:27:05 -0700 Subject: check for success before updating remote id --- mod/impel.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'mod/impel.php') diff --git a/mod/impel.php b/mod/impel.php index f204da36a..e78b3311d 100644 --- a/mod/impel.php +++ b/mod/impel.php @@ -113,17 +113,18 @@ function impel_init(&$a) { } $x = item_store($arr,$execflag); } - if($x['success']) + if($x['success']) { $item_id = $x['item_id']; + update_remote_id($channel,$item_id,$arr['item_restrict'],$pagetitle,$namespace,$remote_id,$arr['mid']); + $ret['success'] = true; + info( sprintf( t('%s element installed'), $installed_type)); + } + else { + notice( sprintf( t('%s element installation failed'), $installed_type)); + } - update_remote_id($channel,$item_id,$arr['item_restrict'],$pagetitle,$namespace,$remote_id,$arr['mid']); - - - $ret['success'] = true; - - info( sprintf( t('%s element installed'), $installed_type)); - +//??? should perhaps return ret? json_return_and_die(true); } -- cgit v1.2.3