1
0
Fork 0

Fix deleting last element from saved folder + Fix displaying empty saved folder

This commit is contained in:
Jonny Tischbein 2018-11-17 12:41:00 +01:00
commit 52eb2281e4
4 changed files with 12 additions and 5 deletions

View file

@ -14,7 +14,7 @@ function filerm_content(App $a)
}
$term = XML::unescape(trim($_GET['term']));
$cat = XML::unescape(trim($_GET['cat']));
$cat = XML::unescape(trim(defaults($_GET, 'cat', '')));
$category = (($cat) ? true : false);
@ -25,12 +25,18 @@ function filerm_content(App $a)
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
Logger::log('filerm: tag ' . $term . ' item ' . $item_id);
Logger::log('filerm: tag ' . $term . ' item ' . $item_id . ' category ' . ($category ? 'true' : 'false'));
if ($item_id && strlen($term))
{
FileTag::unsaveFile(local_user(), $item_id, $term, $category);
if (FileTag::unsaveFile(local_user(), $item_id, $term, $category)){
info('Item removed');
}
}
else {
info('Item was not deleted');
}
$a->internalRedirect('/network?f=&file=' . $term);
killme();
}

View file

@ -346,6 +346,7 @@ function networkConversation(App $a, $items, Pager $pager, $mode, $update, $orde
// Set this so that the conversation function can find out contact info for our wall-wall items
$a->page_contact = $a->contact;
$items = (empty($items) ? [] : $items);
$o = conversation($a, $items, $pager, $mode, $update, false, $ordering, local_user());
if (!$update) {