[FLOW3-general] CONFIGURATION_CREATION_ALLOWED

Mattias Nilsson tollepjaer at gmail.com
Tue Feb 28 14:11:16 CET 2012


Thank you Christian, it works like a charm :)

/Mattias

On Tue, Feb 28, 2012 at 2:06 PM, "Christian Müller (FLOW3 Team)" <
christian.mueller at typo3.org> wrote:

> Hi Mattias,
>
> notice that you only set "allowModification..." and not
> "allowCreation...", which is what the PropertyMapper complains about.
> Probably you create a new "Name" object with your form.
>
> So add:
>
> $this->arguments['account']->**getPropertyMappingConfiguratio**n()->**
> allowCreationForSubProperty('p**arty.name <http://party.name>');
>
> to your initalizeUpdateAction()
>
> Cheers,
> Christian
>
>
> On 28/02/12 13:37, Mattias Nilsson wrote:
>
>> Hello everybody,
>>
>> I have a problem based on an edit form for a user based on the TYPO3.Party
>> package. I have extended the AccountController in the same way as the
>> TYPO3.Blog example, but I get this error message when trying to update a
>> user:
>>
>> *#1297759968: Exception while property mapping at property path
>> "party.name":Creation
>> of objects not allowed. To enable this, you need to set the
>> PropertyMappingConfiguration Value "CONFIGURATION_CREATION_**ALLOWED" to
>> TRUE
>>
>> My controller has this functions:
>>
>> /**
>>      * Displays a form for setting a new password and / or username
>>      *
>>      * @return string An HTML form for editing the account properties
>>      */
>>     public function editAction() {
>>         $activeTokens = $this->securityContext->**
>> getAuthenticationTokens();
>>         foreach ($activeTokens as $token) {
>>             if ($token->isAuthenticated()) {
>>                 $account = $token->getAccount();
>>                 $this->view->assign('account', $account);
>>                 break;
>>             }
>>         }
>>     }
>>
>>     /**
>>      * @return void
>>      */
>>     public function initializeUpdateAction() {
>>
>> $this->arguments['account']->**getPropertyMappingConfiguratio**n()->**
>> setTargetTypeForSubProperty('**party',
>> '\TYPO3\Party\Domain\Model\**Person');
>>
>> $this->arguments['account']->**getPropertyMappingConfiguratio**n()->**
>> allowModificationForSubPropert**y('party');
>>
>> $this->arguments['account']->**getPropertyMappingConfiguratio**n()->**
>> allowModificationForSubPropert**y('
>> party.name');
>>     }
>>
>>     /**
>>      * Updates the account properties
>>      *
>>      * @param TYPO3\FLOW3\Security\Account $account
>>      * @param string $password
>>      * @return void
>>      */
>>     public function updateAction(\TYPO3\FLOW3\**Security\Account
>> $account,
>> $password = '') {
>>         if ($password != '') {
>>
>> $account->**setCredentialsSource($this->**hashService->hashPassword($**
>> password));
>>         }
>>
>>         $this->accountRepository->**update($account);
>>         $this->partyRepository->**update($account->getParty());
>>         $this->addFlashMessage('Your account details have been updated.');
>>         $this->redirect('index', 'Login');
>>     }
>>
>>
>> I have really tried to find a solution, is there anybody with the same
>> problem?
>>
>> Thanks in advance
>> /Mattias
>> *
>>
>
> ______________________________**_________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/flow3-**general<http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general>
>


More information about the FLOW3-general mailing list