Bug #36734

Transient properties cannot be property mapped

Added by Alexander Berl over 9 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Should have
Category:
Property
Target version:
-
Start date:
2012-04-30
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Has patch:
No
Complexity:

Description

When creating an object containing transient properties through a webform an exception is thrown that the property is not found within the object.

Example

Model

/**
 * A Baz
 *
 * @FLOW3\Entity
 */
class Baz {

    /**
     * The password
     * @var string
     * @FLOW3\Transient
     */
    protected $password;
...
}

Form

    <f:form action="create" name="baz" object="{baz}">
        Password: <f:form.textfield property="password" /><br />
        <f:form.submit value="submit" />
    </f:form>

After submitting the form the following exception is thrown:

TYPO3\FLOW3\Property\Exception\InvalidTargetException thrown in file TYPO3_FLOW3_Property_TypeConverter_PersistentObjectConverter_Original.php

Property "password" was not found in target object of type "Foo\Bar\Domain\Model\Baz".
20 TYPO3\FLOW3\Property\TypeConverter\PersistentObjectConverter_Original::getTypeOfChildProperty("Foo\Bar\Domain\Model\Baz", "password", TYPO3\FLOW3\Mvc\Controller\MvcPropertyMappingConfiguration)

19 TYPO3\FLOW3\Property\PropertyMapper_Original::doMapping(array, "Foo\Bar\Domain\Model\Baz", TYPO3\FLOW3\Mvc\Controller\MvcPropertyMappingConfiguration, array)

18 TYPO3\FLOW3\Property\PropertyMapper_Original::convert(array, "Foo\Bar\Domain\Model\Baz", TYPO3\FLOW3\Mvc\Controller\MvcPropertyMappingConfiguration)

17 TYPO3\FLOW3\Mvc\Controller\Argument_Original::setValue(array)

16 TYPO3\FLOW3\Mvc\Controller\AbstractController::mapRequestArgumentsToControllerArguments()

15 TYPO3\FLOW3\Mvc\Controller\ActionController_Original::processRequest(TYPO3\FLOW3\Mvc\ActionRequest, TYPO3\FLOW3\Http\Response)

14 TYPO3\FLOW3\Mvc\Dispatcher_Original::dispatch(TYPO3\FLOW3\Mvc\ActionRequest, TYPO3\FLOW3\Http\Response)

13 TYPO3\FLOW3\Mvc\Dispatcher::dispatch(TYPO3\FLOW3\Mvc\ActionRequest, TYPO3\FLOW3\Http\Response)

12 call_user_func_array(array, array)

11 TYPO3\FLOW3\Mvc\Dispatcher::FLOW3_Aop_Proxy_invokeJoinPoint(TYPO3\FLOW3\Aop\JoinPoint)

10 TYPO3\FLOW3\Aop\Advice\AdviceChain::proceed(TYPO3\FLOW3\Aop\JoinPoint)

9 TYPO3\FLOW3\Security\Aspect\RequestDispatchingAspect_Original::setAccessDeniedResponseHeader(TYPO3\FLOW3\Aop\JoinPoint)

8 TYPO3\FLOW3\Aop\Advice\AroundAdvice::invoke(TYPO3\FLOW3\Aop\JoinPoint)

7 TYPO3\FLOW3\Aop\Advice\AdviceChain::proceed(TYPO3\FLOW3\Aop\JoinPoint)

6 TYPO3\FLOW3\Security\Aspect\RequestDispatchingAspect_Original::blockIllegalRequestsAndForwardToAuthenticationEntryPoints(TYPO3\FLOW3\Aop\JoinPoint)

5 TYPO3\FLOW3\Aop\Advice\AroundAdvice::invoke(TYPO3\FLOW3\Aop\JoinPoint)

4 TYPO3\FLOW3\Aop\Advice\AdviceChain::proceed(TYPO3\FLOW3\Aop\JoinPoint)

3 TYPO3\FLOW3\Mvc\Dispatcher::dispatch(TYPO3\FLOW3\Mvc\ActionRequest, TYPO3\FLOW3\Http\Response)

2 TYPO3\FLOW3\Http\RequestHandler::handleRequest()

1 TYPO3\FLOW3\Core\Bootstrap::run()

The problem here is, that the property is skipped in reflection due to the Transient annotation (see ReflectionService->addPropertiesToClassSchema) and therefore also cannot be property mapped.

see http://lists.typo3.org/pipermail/flow3-general/2012-April/002285.html

Also available in: Atom PDF