[TYPO3-mvc] storagePid and findObjectByUid

Jochen Rau jochen.rau at typoplanet.de
Mon Nov 30 04:52:37 CET 2009


Hi Elías.

Elías Fernández wrote:
> In my repository when i want to update an item, always throw
> Tx_Extbase_MVC_Exception_InvalidArgumentValue exception, because the mapper
> try to use findObjectByUid and it is storagePid dependant.
> ( The edit page is in another page than the list view )
>
> I didn´t find a way of change setRespectStoragePage via pages.
>
> I think here is not very important the restriction of being in the same pid
> or not. Finally, i modify the Mapper class and insert the
> setRespectStoragePage to the findObjectByUid
>
> protected function findObjectByUid($dataType, $uid) {
> $query = $this->queryFactory->create($dataType);
> $query->getQuerySettings()->setRespectStoragePage(FALSE);
> $result = $query->matching($query->withUid($uid))->execute();
> $object = NULL;
> if (count($result)>  0) {
> $object = current($result);
> }
> return $object;
> }

Well, I fully agree with you. We have to provide a way to specify if the 
pid should be respected or not while fetching related objects. IMO we 
should setRespectStoragePage(FALSE) inside findObjectByUid by default.

But maybe Sebastian K. has a contrary opinion ;-)

Regards
Jochen



-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list