[TYPO3-mvc] Confusion about recordTypeColumnName of a model
Sebastian Michaelsen
sebastian.gebhard at gmail.com
Tue Feb 1 16:43:15 CET 2011
I implemented a Model Class for be_users because I want to display the name of an Author (cruser_id)
of a record in the Frontend.
But at first Extbase always failed to get a be_users record for the cruser_id. I took a look at the
generated SQL Query and it looks like this:
SELECT be_users.* FROM be_users WHERE be_users.uid IN (1) AND
(be_users.admin='Tx_Insights_Domain_Model_BeUser') AND be_users.deleted=0 AND be_users.disable=0 AND
be_users.starttime<=1296574560 AND (be_users.endtime=0 OR be_users.endtime>1296574560) LIMIT 1
What's interesting is: be_users.admin='Tx_Insights_Domain_Model_BeUser'
It of course makes the query always return nothing.
This is because the TCA definition says be_users can be of different types according to the field
'admin' which is a boolean field. But extbase seems to think that the record type in terms of what
kind of object it is, is stored in that 'admin' field.
So to me it seems that the TCA-Option "type" is used for two totally different things, which might
be a bug. In my case I added this workaround:
if (TYPO3_MODE == 'FE') {
unset($TCA['be_users']['ctrl']['type']);
}
Maybe I got all that wrong, so I'd be thankful for any explanations.
Kind regards,
Sebastian
P.S. Using TYPO3 4.5
More information about the TYPO3-project-typo3v4mvc
mailing list