Project

General

Profile

Actions

Bug #75440

closed

Creation of objects not allowed. To enable this, you need to set the PropertyMappingConfiguration Value "CONFIGURATION_CREATION_ALLOWED" to TRUE for AbstractValueObject

Added by Bill Dagou over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2016-04-07
Due date:
% Done:

0%

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

Description

Following are my 2 classes.

Address.php

namespace Dagou\Address\Domain\Model;

class Address extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject {
    /**
     * @var string
     */
    $city = '';
    .....
}

FrontendUser.php

namespace Dagou\User\Domain\Model;

class FrontendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
    /**
     * @var Dagou\Address\Domain\Model\Address
     */
    var $address;
    ......
}

When I persis a new FrontendUser,

<f:form action="create" name="user" object="{user}">
    <f:form.textfield property="address.city" />
    ......
</f:form>

It works without any problem. However, when I try to updating a FrontendUser record, it failed.

<f:form action="update" name="user" object="{user}">
    <f:form.textfield property="address.city" />
    ......
</f:form>

And get the following exceptions.

exception 'TYPO3\CMS\Extbase\Property\Exception\InvalidPropertyMappingConfigurationException' with message 'Creation of objects not allowed. To enable this, you need to set the PropertyMappingConfiguration Value "CONFIGURATION_CREATION_ALLOWED" to TRUE' in /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Property/TypeConverter/PersistentObjectConverter.php:198
Stack trace:
#0 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Property/TypeConverter/PersistentObjectConverter.php(153): TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter->handleArrayData(Array, 'Dagou\A...', Array, Object(TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration))
#1 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Property/PropertyMapper.php(199): TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter->convertFrom(Array, 'Dagou\A...', Array, Object(TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration))
#2 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Property/PropertyMapper.php(193): TYPO3\CMS\Extbase\Property\PropertyMapper->doMapping(Array, 'Dagou\A...', Object(TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration), Array)
#3 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Property/PropertyMapper.php(119): TYPO3\CMS\Extbase\Property\PropertyMapper->doMapping(Array, 'Dagou\U...', Object(TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration), Array)
#4 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php(270): TYPO3\CMS\Extbase\Property\PropertyMapper->convert(Array, 'Dagou\U...', Object(TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration))
#5 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php(428): TYPO3\CMS\Extbase\Mvc\Controller\Argument->setValue(Array)
#6 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php(170): TYPO3\CMS\Extbase\Mvc\Controller\AbstractController->mapRequestArgumentsToControllerArguments()
#7 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php(86): TYPO3\CMS\Extbase\Mvc\Controller\ActionController->processRequest(Object(TYPO3\CMS\Extbase\Mvc\Web\Request), Object(TYPO3\CMS\Extbase\Mvc\Web\Response))
#8 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php(69): TYPO3\CMS\Extbase\Mvc\Dispatcher->dispatch(Object(TYPO3\CMS\Extbase\Mvc\Web\Request), Object(TYPO3\CMS\Extbase\Mvc\Web\Response))
#9 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Core/Bootstrap.php(206): TYPO3\CMS\Extbase\Mvc\Web\FrontendRequestHandler->handleRequest()
#10 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Core/Bootstrap.php(193): TYPO3\CMS\Extbase\Core\Bootstrap->handleRequest()
#11 [internal function]: TYPO3\CMS\Extbase\Core\Bootstrap->run('', Array)
#12 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(7315): call_user_func_array(Array, Array)
#13 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/UserContentObject.php(40): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->callUserFunction('TYPO3\CMS\Extba...', Array, '')
#14 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(943): TYPO3\CMS\Frontend\ContentObject\UserContentObject->render(Array)
#15 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(859): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->render(Object(TYPO3\CMS\Frontend\ContentObject\UserContentObject), Array)
#16 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(3566): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->cObjGetSingle('USER', Array)
#17 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(3511): TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript_process(Array)
#18 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(3477): TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->recursivelyReplaceIntPlaceholdersInContent()
#19 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Http/RequestHandler.php(232): TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript()
#20 /var/www/typo3_src-7.6.4/typo3/sysext/core/Classes/Core/Bootstrap.php(302): TYPO3\CMS\Frontend\Http\RequestHandler->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#21 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Http/Application.php(78): TYPO3\CMS\Core\Core\Bootstrap->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#22 /var/www/typo3_src-7.6.4/index.php(33): TYPO3\CMS\Frontend\Http\Application->run()
#23 [internal function]: {closure}()
#24 /var/www/typo3_src-7.6.4/index.php(34): call_user_func(Object(Closure))
#25 {main}

Next exception 'TYPO3\CMS\Extbase\Property\Exception' with message 'Exception while property mapping at property path "address": Creation of objects not allowed. To enable this, you need to set the PropertyMappingConfiguration Value "CONFIGURATION_CREATION_ALLOWED" to TRUE' in /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Property/PropertyMapper.php:128
Stack trace:
#0 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php(270): TYPO3\CMS\Extbase\Property\PropertyMapper->convert(Array, 'Dagou\U...', Object(TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration))
#1 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php(428): TYPO3\CMS\Extbase\Mvc\Controller\Argument->setValue(Array)
#2 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php(170): TYPO3\CMS\Extbase\Mvc\Controller\AbstractController->mapRequestArgumentsToControllerArguments()
#3 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php(86): TYPO3\CMS\Extbase\Mvc\Controller\ActionController->processRequest(Object(TYPO3\CMS\Extbase\Mvc\Web\Request), Object(TYPO3\CMS\Extbase\Mvc\Web\Response))
#4 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php(69): TYPO3\CMS\Extbase\Mvc\Dispatcher->dispatch(Object(TYPO3\CMS\Extbase\Mvc\Web\Request), Object(TYPO3\CMS\Extbase\Mvc\Web\Response))
#5 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Core/Bootstrap.php(206): TYPO3\CMS\Extbase\Mvc\Web\FrontendRequestHandler->handleRequest()
#6 /var/www/typo3_src-7.6.4/typo3/sysext/extbase/Classes/Core/Bootstrap.php(193): TYPO3\CMS\Extbase\Core\Bootstrap->handleRequest()
#7 [internal function]: TYPO3\CMS\Extbase\Core\Bootstrap->run('', Array)
#8 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(7315): call_user_func_array(Array, Array)
#9 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/UserContentObject.php(40): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->callUserFunction('TYPO3\CMS\Extba...', Array, '')
#10 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(943): TYPO3\CMS\Frontend\ContentObject\UserContentObject->render(Array)
#11 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(859): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->render(Object(TYPO3\CMS\Frontend\ContentObject\UserContentObject), Array)
#12 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(3566): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->cObjGetSingle('USER', Array)
#13 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(3511): TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript_process(Array)
#14 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(3477): TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->recursivelyReplaceIntPlaceholdersInContent()
#15 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Http/RequestHandler.php(232): TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript()
#16 /var/www/typo3_src-7.6.4/typo3/sysext/core/Classes/Core/Bootstrap.php(302): TYPO3\CMS\Frontend\Http\RequestHandler->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#17 /var/www/typo3_src-7.6.4/typo3/sysext/frontend/Classes/Http/Application.php(78): TYPO3\CMS\Core\Core\Bootstrap->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#18 /var/www/typo3_src-7.6.4/index.php(33): TYPO3\CMS\Frontend\Http\Application->run()
#19 [internal function]: {closure}()
#20 /var/www/typo3_src-7.6.4/index.php(34): call_user_func(Object(Closure))
#21 {main}

Not sure whether it's a bug or my fault.

Actions #1

Updated by Wouter Wolters over 8 years ago

  • Status changed from New to Closed

Hi Bill,

This is a bugtracker and not a forum to ask for help.
Please try to get some help on our mailinglist or in our Slack channel.

See https://github.com/TYPO3/TYPO3.CMS#chat-with-us for more information.

Actions

Also available in: Atom PDF