[BUGFIX] FormEngine group element top/bottom buttons 11/51111/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 4 Jan 2017 10:38:48 +0000 (11:38 +0100)
committerJan Helke <typo3@helke.de>
Wed, 4 Jan 2017 11:22:34 +0000 (12:22 +0100)
The sort top/bottom buttons in group element no longer depend
on the number of selected items. This is inconvenient anyway
since these sorting buttons only appeared after saving when
a bunch of items was selected, but not immediately.
The patch additionally fixes a failing acceptance test.

Change-Id: Ice0d179e7c74c3a1227c727c672b40844d6852c8
Resolves: #79149
Related: #78899
Releases: master
Reviewed-on: https://review.typo3.org/51111
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/backend/Classes/Form/Element/GroupElement.php

index 8fe96d8..217f30b 100644 (file)
@@ -383,7 +383,7 @@ class GroupElement extends AbstractFormElement
 
         $html[] =   '<div class="form-wizards-items">';
         $html[] =       '<div class="btn-group-vertical">';
-        if ($maxItems > 1 && $size >=5 && $selectedItemsCount >=5 && !$isDisabled && $showMoveIcons) {
+        if ($maxItems > 1 && $size >=5 && !$isDisabled && $showMoveIcons) {
             $html[] =       '<a href="#"';
             $html[] =           ' class="btn btn-default t3js-btn-moveoption-top"';
             $html[] =           ' data-fieldname="' . htmlspecialchars($elementName) . '"';
@@ -408,7 +408,7 @@ class GroupElement extends AbstractFormElement
             $html[] =           $this->iconFactory->getIcon('actions-move-down', Icon::SIZE_SMALL)->render();
             $html[] =       '</a>';
         }
-        if ($maxItems > 1 && $size >=5 && $selectedItemsCount >=5 && !$isDisabled && $showMoveIcons) {
+        if ($maxItems > 1 && $size >=5 && !$isDisabled && $showMoveIcons) {
             $html[] =       '<a href="#"';
             $html[] =           ' class="btn btn-default t3js-btn-moveoption-bottom"';
             $html[] =           ' data-fieldname="' . htmlspecialchars($elementName) . '"';