[TYPO3-mvc] New PropertyMapper not respecting config.tx_extbase.objects?
Kai
kai.tallafus at gmx.at
Mon Jun 18 14:05:58 CEST 2012
Hi all,
i have the following problem:
let´s say there is a createAction for a User Domain Model:
/**
* @param Tx_SomeExt_Domain_Model_FrontendUser $user
*/
public function createAction(Tx_SomeExt_Domain_Model_FrontendUser $user) {}
And now i want to replace the Tx_SomeExt_Domain_Model_FrontendUser class with Tx_MyExt_Domain_Model_FrontendUser:
config.tx_extbase.objects {
Tx_SomeExt_Domain_Model_FrontendUser {
className = Tx_MyExt_Domain_Model_FrontendUser
}
}
The Tx_MyExt_Domain_Model_FrontendUser has a new property, which is declared in TS and added to the forms:
config.tx_extbase.persistence.classes {
Tx_SomeExt_Domain_Model_FrontendUser {
subclasses {
Tx_MyExt_Domain_Model_FrontendUser = Tx_MyExt_Domain_Model_FrontendUser
}
mapping {
columns {
tx_myext_show_customer_data_on_cover.mapOnProperty = showCustomerDataOnCover
}
}
}
After submitting the form to the createAction, i get this error message:
Property "showCustomerDataOnCover" was not found in target object of type "Tx_SomeExt_Domain_Model_FrontendUser"
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...
Regards
Kai
More information about the TYPO3-project-typo3v4mvc
mailing list