$tags = $fields['tag'];
$fields['tag'] = null;
} else {
- $tags = '';
+ $tags = null;
}
if (array_key_exists('file', $fields)) {
}
}
- if (!empty($tags)) {
+ if (!is_null($tags)) {
Term::insertFromTagFieldByItemId($item['id'], $tags);
if (!empty($item['tag'])) {
DBA::update('item', ['tag' => ''], ['id' => $item['id']]);
*
* @return boolean success
*/
- private static function deleteById($item_id, $priority = PRIORITY_HIGH)
+ public static function deleteById($item_id, $priority = PRIORITY_HIGH)
{
// locate item to be deleted
$fields = ['id', 'uri', 'uid', 'parent', 'parent-uri', 'origin',