[TYPO3-mvc] update hidden / disabled records

Frank Krüger fkrueger-ml at mp-group.net
Mon Apr 2 14:07:45 CEST 2012


Hi,

you can try
  ' $query->getQuerySettings()->setRespectEnableFields(FALSE);'
In your repository, this should disable the enable-field query.

Best regards,
Frank

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
typo3 at litedesigns.nl
Gesendet: Montag, 2. April 2012 13:18
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] update hidden / disabled records

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



_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list