diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-05-19 18:25:27 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-05-19 18:25:27 -0700 |
commit | fe00d29047da1cb99cbc06af938268ec9e6a8fcb (patch) | |
tree | cd072972bd375cff34781ca3fe96d801d5915649 | |
parent | e54198e5b8c0534a9021f4a494cf6fa504fc72ac (diff) | |
download | volse-hubzilla-fe00d29047da1cb99cbc06af938268ec9e6a8fcb.tar.gz volse-hubzilla-fe00d29047da1cb99cbc06af938268ec9e6a8fcb.tar.bz2 volse-hubzilla-fe00d29047da1cb99cbc06af938268ec9e6a8fcb.zip |
issue with deleting imported design elements and re-installing them
-rw-r--r-- | mod/impel.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mod/impel.php b/mod/impel.php index f4d40f7a8..f204da36a 100644 --- a/mod/impel.php +++ b/mod/impel.php @@ -91,10 +91,11 @@ function impel_init(&$a) { dbesc($namespace), intval(local_channel()) ); - $i = q("select id from item where mid = '%s' and uid = %d limit 1", + $i = q("select id, item_restrict from item where mid = '%s' and uid = %d limit 1", dbesc($arr['mid']), intval(local_channel()) ); + if($z && $i) { $remote_id = $z[0]['id']; $arr['id'] = $i[0]['id']; @@ -103,6 +104,13 @@ function impel_init(&$a) { $x = item_store_update($arr,$execflag); } else { + if(($i) && ($i[0]['item_restrict'] & ITEM_DELETED)) { + // was partially deleted already, finish it off + q("delete from item where mid = '%s' and uid = %d", + dbesc($arr['mid']), + intval(local_channel()) + ); + } $x = item_store($arr,$execflag); } if($x['success']) |