Browse Source

Only perform Term::deleteAllTags when needed + not needed redirect

pull/6003/head
Jonny Tischbein 3 years ago
parent
commit
26ed71cc14
2 changed files with 3 additions and 5 deletions
  1. +0
    -3
      mod/tagrm.php
  2. +3
    -2
      src/Model/Item.php

+ 0
- 3
mod/tagrm.php View File

@ -71,9 +71,6 @@ function update_tags($item_id, $tags){
Item::update(['tag' => $tag_str], ['id' => $item_id]);
info(L10n::t('Tag(s) removed') . EOL );
$a->internalRedirect($_SESSION['photo_return']);
// NOTREACHED
}
function tagrm_content(App $a)


+ 3
- 2
src/Model/Item.php View File

@ -896,14 +896,15 @@ class Item extends BaseObject
}
if (!is_null($tags)) {
Term::deleteAllTags($item['id']);
if ($tags) {
Term::insertFromTagFieldByItemId($item['id'], $tags);
if (!empty($item['tag'])) {
DBA::update('item', ['tag' => ''], ['id' => $item['id']]);
}
}
else {
Term::deleteAllTags($item['id']);
}
}
if (!empty($files)) {


Loading…
Cancel
Save