[BUGFIX] Wrong name attribute in custom user rendered items
authorOliver Hader <oliver@typo3.org>
Sun, 19 Aug 2012 11:43:45 +0000 (13:43 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 20 Aug 2012 12:14:28 +0000 (14:14 +0200)
Configuration items/properties that use a user function to
render the accordant values and possibilities (like, e.g.
saltedpasswords does in the Core) have a wrong name attribute.

The information to be delivered shall be:
* fieldName: Extbase prefixed form name
* fieldValue: the value of the field to be shown
* propertyName: Name of the property, e.g. "some.setting"

Change-Id: I19a11b20b9a897632e17c6bd9919d8cd6fe0b155
Fixes: #39958
Releases: 6.0
Reviewed-on: http://review.typo3.org/13918
Reviewed-by: Wouter Wolters
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/ViewHelpers/Form/TypoScriptConstantsViewHelper.php
typo3/sysext/saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php

index 9f81be6..46c3668 100644 (file)
@@ -263,7 +263,11 @@ class Tx_Extensionmanager_ViewHelpers_Form_TypoScriptConstantsViewHelper
         */
        protected function renderUserFunction(Tx_Extensionmanager_Domain_Model_ConfigurationItem $configuration) {
                $userFunction = $configuration->getGeneric();
-               $userFunctionParams = array('fieldName' => $configuration->getName(), 'fieldValue' => $configuration->getValue());
+               $userFunctionParams = array(
+                       'fieldName' => $this->getName($configuration),
+                       'fieldValue' => $configuration->getValue(),
+                       'propertyName' => $configuration->getName(),
+               );
                return t3lib_div::callUserFunction($userFunction, $userFunctionParams, $this, '');
        }
 
index 5f0c33d..3587834 100644 (file)
@@ -401,8 +401,8 @@ EOT;
         */
        protected function buildHashMethodSelector(array $params, $pObj, $disposal) {
                $this->init();
-               $fieldName = substr($params['fieldName'], 5, -1);
-               $unknownVariablePleaseRenameMe = '\'' . substr(md5($fieldName), 0, 10) . '\'';
+               $propertyName = $params['propertyName'];
+               $unknownVariablePleaseRenameMe = '\'' . substr(md5($propertyName), 0, 10) . '\'';
 
                $p_field = '';
 
@@ -416,7 +416,7 @@ EOT;
                        }
                }
 
-               $p_field = '<select id="' . $fieldName . '" name="' . $params['fieldName'] . '" onChange="uFormUrl(' . $unknownVariablePleaseRenameMe . ')">' . $p_field . '</select>';
+               $p_field = '<select id="' . $propertyName . '" name="' . $params['fieldName'] . '" onChange="uFormUrl(' . $unknownVariablePleaseRenameMe . ')">' . $p_field . '</select>';
 
                return $p_field;
        }