[TYPO3-mvc] Relations to non existing Domain-Models (eg. fe_groups and sys_language)

Benno Weinzierl benno_weinzierl at web.de
Mon Jul 20 16:42:31 CEST 2009


Hi Jochen,

i have overlooked your Post regarding this issue. The patch was just to 
proove my point and place emphasis on that matter because others like 
Christopher are having the same problem.

I will read your post now... :-)

Tanks for the Info
Benno



"Jochen Rau" <jochen.rau at typoplanet.de> schrieb im Newsbeitrag 
news:mailman.1.1248095032.12878.typo3-project-typo3v4mvc at lists.netfielders.de...
> Hi.
>
> Benno Weinzierl wrote:
>> Hey guys,
>>
>> i think that Issue #3440 is not a feature as declared but it is a bug 
>> that
>> should be fixed before extbase is out of alpha-state.
>>
>> The reason:
>> I have a Model with a relation to fe_groups. There is not yet a Model for
>> fe_groups but thats not the Problem.
>> The big problem is that this beakes my plugin with a broken sql-statement
>> because of a missing classname in the TCA.
>>
>> It can be easily fixed by the following code:
>>
>> Index: Classes/Persistence/Mapper/DataMapper.php
>> ===================================================================
>> --- Classes/Persistence/Mapper/DataMapper.php (revision 970)
>> +++ Classes/Persistence/Mapper/DataMapper.php (working copy)
>> @@ -220,7 +220,7 @@
>>      if ($columnMap->getTypeOfRelation() ===
>> Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_ONE) {
>>       $query = 
>> $this->queryFactory->create($columnMap->getChildClassName());
>>       $result =
>> current($query->matching($query->withUid($row[$columnMap->getColumnName()]))->execute());
>> -   } elseif ($columnMap->getTypeOfRelation() ===
>> Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY) {
>> +   } elseif ($columnMap->getTypeOfRelation() ===
>> Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY&&
>> $columnMap->getChildClassName()) {
>>       $objectStorage = new Tx_Extbase_Persistence_ObjectStorage();
>>       $query = 
>> $this->queryFactory->create($columnMap->getChildClassName());
>>       $objects =
>> $query->matching($query->equals($columnMap->getParentKeyFieldName(),
>> $parentObject->getUid()))->execute();
>>
>>
>> Is it possible to include this? Maybe some more code is needed for the 
>> other
>> relations but this fixes my broken relation to fe_groups.
>
> Thanks for your patch. We intend to implement a more general solution for 
> this issue.
>
> Please see my post "FYI: Progress in implementing support for generic 
> domain models" for more information.
>
> Regards
> Jochen
>
>
> -- 
> Every nit picked is a bug fixed
> 




More information about the TYPO3-project-typo3v4mvc mailing list