Skip to content

Commit 604aed2

Browse files
committed
[BUGFIX] Removing tags is not working properly
1 parent b05f780 commit 604aed2

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Classes/Controller/ItemController.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
***************************************************************/
2626

2727
use TYPO3\CMS\Core\Messaging\FlashMessage;
28-
use TYPO3\CMS\Core\Utility\GeneralUtility;
2928
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
3029

3130
/**
@@ -167,14 +166,10 @@ public function bulkUpdateAction()
167166
/* @var $album Tx_Yag_Domain_Model_Album */
168167

169168
if ($album == null) {
170-
$this->flashMessageContainer->add(
171-
\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_yag_controller_album.noAlbumSelected', $this->extensionName), '', FlashMessage::ERROR
172-
);
173-
169+
$this->addFlashMessage(LocalizationUtility::translate('tx_yag_controller_album.noAlbumSelected', $this->extensionName), '', FlashMessage::ERROR);
174170
$this->forward('list', 'ItemList');
175171
}
176172

177-
178173
// Do we have to change thumb for album?
179174
if (!$album->getThumb() instanceof Tx_Yag_Domain_Model_Item || $album->getThumb()->getUid() != $bulkEditData['album']['thumb']) {
180175
$thumb = $this->itemRepository->findByUid($bulkEditData['album']['thumb']);

Classes/Domain/Model/Item.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,10 @@ public function getIsLandscape()
847847
public function setTagsFromCSV($tagsAsCSV)
848848
{
849849
$tags = array_filter(GeneralUtility::trimExplode(',', $tagsAsCSV));
850+
$currentTags = clone $this->tags;
850851

851-
foreach ($this->tags as $tag) { /** @var Tx_Yag_Domain_Model_Tag $tag */
852-
if (!in_array($tag->getName(), $tags)) {
852+
foreach ($currentTags as $tag) { /** @var Tx_Yag_Domain_Model_Tag $tag */
853+
if (!in_array(trim($tag->getName()), $tags)) {
853854
$tag->decreaseCount();
854855
$this->tags->detach($tag);
855856
}

0 commit comments

Comments
 (0)