diff --git a/include/items.php b/include/items.php index b802a59bdb..50c5e56c12 100644 --- a/include/items.php +++ b/include/items.php @@ -1924,7 +1924,7 @@ function local_delivery($importer,$data) { if($deleted) { $r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id` - WHERE `uri` = '%s' AND `uid` = %d AND `contact-id` = %d LIMIT 1", + WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1", dbesc($uri), intval($importer['importer_uid']), intval($importer['id']) diff --git a/mod/network.php b/mod/network.php index e05791614d..8df3f83df4 100644 --- a/mod/network.php +++ b/mod/network.php @@ -68,17 +68,16 @@ function saved_searches($search) { $o = ''; - $r = q("select `term` from `search` WHERE `uid` = %d", + $r = q("select `id`,`term` from `search` WHERE `uid` = %d", intval(local_user()) ); $saved = array(); - - if(count($r)) { foreach($r as $rr) { $saved[] = array( + 'id' => $rr['id'], 'term' => $rr['term'], 'encodedterm' => urlencode($rr['term']), 'delete' => t('Remove term'), diff --git a/mod/search.php b/mod/search.php index 819100204c..0b58db5d17 100644 --- a/mod/search.php +++ b/mod/search.php @@ -4,7 +4,7 @@ function search_saved_searches() { $o = ''; - $r = q("select `term` from `search` WHERE `uid` = %d", + $r = q("select `id`,`term` from `search` WHERE `uid` = %d", intval(local_user()) ); diff --git a/view/theme/duepuntozero/saved_searches_aside.tpl b/view/theme/duepuntozero/saved_searches_aside.tpl index e2aae1e77c..e6a0d6278d 100644 --- a/view/theme/duepuntozero/saved_searches_aside.tpl +++ b/view/theme/duepuntozero/saved_searches_aside.tpl @@ -5,8 +5,8 @@