[TYPO3-mvc] update hidden / disabled records

typo3 at litedesigns.nl typo3 at litedesigns.nl
Mon Apr 2 13:17:47 CEST 2012


Hi List,

I have a question about updating hidden records (based on http://forge:
http://forge.typo3.org/issues/8483) and i'm looking for an (temporary)
workaround.

I have a Company with a 1:1 relation to a FrontendUser. Visitors can
create their own account, this is a single form with both Company and
FrontendUser fields. But i want to send the visitor an activation email
with a link to activate their account.

Therefor i set the FrontendUser to 'disable=1' (fe_users table) upon
creating the Company and FrontendUser. This way they can't login yet
before they have activated their account via the activation email.

But how can i retrieve my FrontendUser in my Controller when the
FrontendUser is still disabled?

$company->getFrontendUser() does not return anything because of the
'enableFields' in the persistence layers of extbase.

Should i add an extra field in my Company model, something like
fe_user_id? This then should be an integer, opposed to company.fe_user
which is a foreign key relation to the fe_users table. Because fe_user_id
is an integer, i can retrieve the id of the fe_user with
$company->getFeUserId() and then in my repository i can set
$querySettings->setRespectEnableFields(FALSE); to retrieve my FrontendUser
object. And if i change the disable to 0 (false), will it be saved or will
Extbase not update the FrontendUser because it is disabled?

Is this the easiest solution or does anyone have another approach?

Kind regards,
Tim





More information about the TYPO3-project-typo3v4mvc mailing list