Fix deleting last element from saved folder + Fix displaying empty saved folder
This commit is contained in:
@@ -290,7 +290,7 @@ class FileTag
|
||||
return false;
|
||||
}
|
||||
|
||||
$fields = ['file' => str_replace($pattern, '', $item['file'])];
|
||||
$fields = ['file' => str_replace($pattern, null, $item['file'])];
|
||||
Item::update($fields, ['id' => $item_id]);
|
||||
|
||||
$r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
|
||||
|
||||
@@ -911,7 +911,7 @@ class Item extends BaseObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($files)) {
|
||||
if (!is_null($files)) {
|
||||
Term::insertFromFileFieldByItemId($item['id'], $files);
|
||||
if (!empty($item['file'])) {
|
||||
DBA::update('item', ['file' => ''], ['id' => $item['id']]);
|
||||
|
||||
Reference in New Issue
Block a user