[BUGFIX] Provide correct FormEngine instance to userFunc 74/33174/4
authorAlexander Opitz <opitz.alexander@googlemail.com>
Mon, 6 Oct 2014 15:25:26 +0000 (17:25 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 7 Oct 2014 17:32:38 +0000 (19:32 +0200)
Use the FormEngine while calling the UserFunction inside the UserElement
as this was expected before splitting the elements out of FormEngine
class.

Resolves: #62060
Releases: master
Change-Id: I249b6a50cb95ee69c34b9d1d6a24ac19934e66a1
Reviewed-on: http://review.typo3.org/33174
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/Element/UserElement.php

index 3d29d53..f546a83 100644 (file)
@@ -36,7 +36,11 @@ class UserElement extends AbstractFormElement {
                $additionalInformation['parameters'] = isset($additionalInformation['fieldConf']['config']['parameters'])
                        ? $additionalInformation['fieldConf']['config']['parameters']
                        : array();
-               $additionalInformation['pObj'] = &$this;
-               return GeneralUtility::callUserFunction($additionalInformation['fieldConf']['config']['userFunc'], $additionalInformation, $this);
+               $additionalInformation['pObj'] = $this->formEngine;
+               return GeneralUtility::callUserFunction(
+                       $additionalInformation['fieldConf']['config']['userFunc'],
+                       $additionalInformation,
+                       $this->formEngine
+               );
        }
 }