Feature #75652
closedUser-Elements cannot add RequireJS-Modules
0%
Description
Currently TCA UserElements cannot add JavaScript to the resultArray of TYPO3\CMS\Backend\Form\AbstractNode. They can only manipulate the HTML:
https://github.com/TYPO3/TYPO3.CMS/blob/b63420e/typo3/sysext/backend/Classes/Form/Element/UserElement.php#L39
Of course it is possible to add the RequireJS-Modules directly:
GeneralUtility::makeInstance(PageRenderer::class)->loadRequireJsModule('TYPO3/CMS/EXTENSION/JS_MODULE');
But this does not work in inline-elements. The FormInlineAjaxController only checks the data in the result-array and adds it to the Ajax-Response:
https://github.com/TYPO3/TYPO3.CMS/blob/b63420e/typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php#L658
An easy fix would be to add the resultArray as reference-parameter to the UserFunc:
$resultArray = $this->initializeResultArray(); $parameterArray['resultArray'] =& $resultArray; $resultArray['html'] = GeneralUtility::callUserFunction( $parameterArray['fieldConf']['config']['userFunc'], $parameterArray, $this );
Updated by Gerrit Code Review about 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review about 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review about 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review about 8 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review about 8 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review about 8 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review about 8 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review almost 7 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Gerrit Code Review almost 7 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49690
Updated by Christian Kuhn about 6 years ago
- Status changed from Under Review to Rejected
i decided against this solution: a type=user with an own renderType is much more flexible than trying to extend the old school 'userFunc' bound solution.
renderType handling is exlpained meanwhile in core api docs: https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/FormEngine/Rendering/Index.html