From c3a20ad721a066b85736f601ed4785b093b5dfa4 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 3 May 2014 22:53:55 +0200 Subject: [PATCH] Added unused tag purging in post tag edit jobs --- src/Api/Jobs/EditPostTagsJob.php | 1 + src/Api/Jobs/TogglePostTagJob.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Api/Jobs/EditPostTagsJob.php b/src/Api/Jobs/EditPostTagsJob.php index 9d8f8471..57d95c2a 100644 --- a/src/Api/Jobs/EditPostTagsJob.php +++ b/src/Api/Jobs/EditPostTagsJob.php @@ -11,6 +11,7 @@ class EditPostTagsJob extends AbstractPostJob $newTags = array_map(function($tag) { return $tag->name; }, $post->getTags()); PostModel::save($post); + TagModel::removeUnused(); foreach (array_diff($oldTags, $newTags) as $tag) { diff --git a/src/Api/Jobs/TogglePostTagJob.php b/src/Api/Jobs/TogglePostTagJob.php index 5dcf4f68..e8400484 100644 --- a/src/Api/Jobs/TogglePostTagJob.php +++ b/src/Api/Jobs/TogglePostTagJob.php @@ -30,6 +30,7 @@ class TogglePostTagJob extends AbstractPostJob $post->setTags($tags); PostModel::save($post); + TagModel::removeUnused(); if ($enable) {