Bug #66688

Story #69712: Further FormEngine development

FormEngine: returnFieldJS() for type=text eval not implemented

Added by Christian Kuhn over 4 years ago. Updated about 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2015-04-30
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

It is documented in TCA reference that type=text can be eval'd with returnFieldJS, but that is not implemented.

A section similar to this is missing in TextElement:

                // Going through all custom evaluations configured for this field
                foreach ($evalList as $evalData) {
                    $evalObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData] . ':&' . $evalData);
                    if (is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
                        $resultArray['extJSCODE'] .= LF . 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($evalData) . '] = function(value) {' . $evalObj->returnFieldJS() . '}';
                        $paramsList = GeneralUtility::quoteJSvalue($parameterArray['itemFormElName']) . ',' . GeneralUtility::quoteJSvalue($evalData) . ',' . GeneralUtility::quoteJSvalue(trim($config['is_in'])) . ',' . ($config['checkbox'] ? 1 : 0) . ',' . GeneralUtility::quoteJSvalue($config['checkbox']);
                        $parameterArray['fieldChangeFunc'] = array_merge(array('typo3form.fieldGet' => 'typo3form.fieldGet(' . $paramsList . ');'), $parameterArray['fieldChangeFunc']);
                    }
                }

This does not work since fieldGet JS works on _hr input names, which is not done for type=text, but for type=input only ...

This issue could be solved if the _hr fieldname madness is solved.

ext:styleguide has examples for this in input_21 and type_9

Also, the documentation should be improved and namespaced, and the tx_ prefix is not required anymore, see the two styleguide fields for examples.

http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Text/Index.html#eval


Related issues

Related to TYPO3 Core - Epic #63846: Refactoring of form element classes Closed 2014-12-14
Related to TYPO3 Core - Bug #61370: Missing feature with eval user function Closed 2014-09-05

History

#1 Updated by Christian Kuhn over 4 years ago

Also, documentation of "deevaluateFieldValue()" is completely missing in documentation.

#2 Updated by Christian Kuhn about 4 years ago

  • Parent task set to #69712

#3 Updated by Riccardo De Contardi over 3 years ago

  • Category set to FormEngine aka TCEforms

Also available in: Atom PDF