]> git.mxchange.org Git - friendica.git/commitdiff
Only perform Term::deleteAllTags when needed + not needed redirect
authorJonny Tischbein <jonny_tischbein@systemli.org>
Tue, 23 Oct 2018 11:38:31 +0000 (13:38 +0200)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Thu, 25 Oct 2018 19:47:10 +0000 (21:47 +0200)
mod/tagrm.php
src/Model/Item.php

index 4bdaeb32f12b6e7272218e13110b2e15f9f9a434..8497bc28a6714ff1e1926cf91e56c1058d1f2986 100644 (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)
index 9b016295ee91a09a75bef832b0ad64f3c8b7983f..3df24293131d7e210420e68a1778aab067cae7df 100644 (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)) {