[BUGFIX] Default behaviour for field rendering of configuration is dropped
authorNicole Cordes <nicole@cordes.co>
Sat, 17 Nov 2012 00:10:43 +0000 (01:10 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 20 Nov 2012 18:07:31 +0000 (19:07 +0100)
In TYPO3 4.7 (and below) the default field of a configuration was a text
field. With a wrong configuration type in ext_conf_template.txt now the
field isn't rendered any more. There should be a fallback to a normal
input field like it used to.

Fixes: #43042
Releases: 6.0

Change-Id: Ic49c9b19a7f8f1795889f17ed5c1efa364dfd9b9
Reviewed-on: http://review.typo3.org/16503
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/extensionmanager/Classes/ViewHelpers/Form/TypoScriptConstantsViewHelper.php

index a0cf6bc..bd7da58 100644 (file)
@@ -45,7 +45,8 @@ class TypoScriptConstantsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abs
                'user' => 'renderUserFunction',
                'small' => 'renderSmallTextField',
                'string' => 'renderTextField',
-               'input' => 'renderTextField'    // only for backwards compatibility
+               'input' => 'renderTextField',   // only for backwards compatibility, will be removed with TYPO3 6.1
+               'default' => 'renderTextField'  // only for backwards compatibility, will be removed with TYPO3 6.1
        );
 
        public $tagName = 'input';
@@ -72,7 +73,10 @@ class TypoScriptConstantsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abs
                $input = '';
                if (isset($this->viewHelperMapping[$configuration->getType()]) && method_exists($this, $this->viewHelperMapping[$configuration->getType()])) {
                        $input = $this->{$this->viewHelperMapping[$configuration->getType()]}($configuration);
+               } else {
+                       $input = $this->{$this->viewHelperMapping['default']}($configuration);
                }
+
                return $input;
        }
 
@@ -203,6 +207,10 @@ class TypoScriptConstantsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abs
         * @return string
         */
        protected function renderTextField(\TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $configuration) {
+               if ($configuration->getType() !== 'string') {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The type "' . $configuration->getType() .
+                               '" is deprecated and will be removed with TYPO3 6.1');
+               }
                $this->tag->setTagName('input');
                $this->tag->addAttribute('type', 'text');
                $this->tag->addAttribute('name', $this->getName($configuration));