[BUGFIX] Default size for group-type fields 16/28116/4
authorChristian Plattner <ccpp@gmx.at>
Thu, 6 Mar 2014 17:09:34 +0000 (18:09 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Thu, 6 Mar 2014 22:56:57 +0000 (23:56 +0100)
Missing size property on group-type fields causes various
problems, like missing controls (move to top and move to
bottom) or misbehaving JS. Adding a default size ensures
that a forgotten size property does not break everything.

Additionally the size property is added to the sys_collection
table, since all Core tables should be cleanly defined.

Resolves: #23552
Documentation: #56627
Releases: 6.1, 6.2
Change-Id: Idafb1912f9702fddf85b7c2c222f408419e50ecf
Reviewed-on: https://review.typo3.org/28116
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/core/Configuration/TCA/sys_collection.php

index be8ec9b..10a4921 100644 (file)
@@ -2409,7 +2409,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                $config = $PA['fieldConf']['config'];
                $internal_type = $config['internal_type'];
                $show_thumbs = $config['show_thumbs'];
-               $size = (int)$config['size'];
+               $size = isset($config['size']) ? (int)$config['size'] : 5;
                $maxitems = MathUtility::forceIntegerInRange($config['maxitems'], 0);
                if (!$maxitems) {
                        $maxitems = 100000;
index fddbc09..e344e22 100644 (file)
@@ -139,7 +139,8 @@ return array(
                                'allowed' => '*',
                                'MM' => 'sys_collection_entries',
                                'MM_hasUidField' => TRUE,
-                               'multiple' => TRUE
+                               'multiple' => TRUE,
+                               'size' => 5
                        )
                ),
                'title' => array(