[TYPO3-mvc] New PropertyMapper not respecting config.tx_extbase.objects?
Kai
kai.tallafus at gmx.at
Tue Jun 19 09:50:29 CEST 2012
Hi,
thanks, I tried your suggestion without success. TS current setup:
config.tx_extbase.persistence.classes {
Tx_SomeExt_Domain_Model_FrontendUser {
subclasses {
Tx_MyExt_Domain_Model_FrontendUser = Tx_MyExt_Domain_Model_FrontendUser
}
}
Tx_MyExt_Domain_Model_FrontendUser {
mapping {
tableName = fe_users
recordType = Tx_MyExt_Domain_Model_FrontendUser
columns {
tx_myext_show_customer_data_on_cover.mapOnProperty = showCustomerDataOnCover
}
}
}
}
Please note that this also occurs in the createAction where the recordType should have no effect on mapping (imho). This is the error message:
Fatal error: Uncaught exception 'Tx_Extbase_Property_Exception_InvalidTargetException' with message 'Property "showCustomerDataOnCover" was not found in target object of type "Tx_SomeExt_Domain_Model_FrontendUser".' in xxx\typo3\sysext\extbase\Classes\Property\PropertyMapper.php on line 128
Another problem is that do not want to use a recordType, because I want my extension to work with any existing fe_users (e.g. from mm_forum) without having to update the database...
My current workaround is to override the foreign controller and redeclare createAction and editAction with the correct annotation.
I don´t know, maybe I´m missunderstanding some concepts of extbase persistence...
Any other suggestions?
Greets, Kai
Tuesday, June 19, 2012, 12:01:44 AM, you wrote:
> Hi,
> On 18.06.12 14:05, Kai wrote:
>> By debugging I found out that the problem is in Tx_Extbase_Property_TypeConverter_PersistentObjectConverter::getTypeOfChildProperty(). This is called while mapping the field showCustomerDataOnCover. This method first looks in some unknown (for me) configuration for the definition for a $configuredTargetType. If none is found it loads the classSchema from reflection und tests if the property is defined in the class. The problem here is, that reflection allways get´s the schema for the Domain Model annotated in the controller action, which is Tx_SomeExt_Domain_Model_FrontendUser. But this is wrong because my TS configuration says it shoult use Tx_MyExt_Domain_Model_FrontendUser.
>> Why is this so? Would be great if someone has some more detailed information on this...
> Did you set the tx_extbase_type field correctly set for all records in
> the fe_users table? This is mandatory for single table inheritance.
> If not, try
> UPDATE fe_users SET tx_extbase_type='Tx_MyExt_Domain_Model_FrontendUser'
> (at you own risk ;)
> Kind regards,
> Helmut
More information about the TYPO3-project-typo3v4mvc
mailing list