check for success before updating remote id

This commit is contained in:
redmatrix 2015-05-20 19:27:05 -07:00
parent 0826c5fd96
commit 0689816772

View File

@ -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);
}