[TYPO3-mvc] Reference not loaded

Christian Zenker christian.zenker at 599media.de
Tue Sep 28 10:10:54 CEST 2010


Hi Thomas.

> When I annotate the property with integer instead of my Model it returns  
> the correct UID.

So your TCA and mapping should be correct. Maybe you could try to  
overwrite the findByUid() method in the corresponding repository. Maybe  
one of the query settings blocks your record from being found.

> I triple checked everything. From mapping, through model classes to  
> storagePID etc. Nothing... :-/
Are you *REALLY* sure you set the storagePID correctly? :) It was my error  
in most of the cases. If your tt_address records are on a different page,  
you'll have to include them.

> Has anybody an idea what is going wrong here. Maybe someone can point me  
> to the piece of code that tries to fetch the references so I can try to  
> find out what is wrong!?
You'll find that code in the mapper.

> Is there some sort of logging of the requests that are done on the  
> database?
There was some debug line in an extbase class you could uncomment to lock  
all database queries - but I don't remember where. (search the list about  
a month ago)
But I use the mySQL built-in functionality for that.

> If you need further information, let me know. This issue is important  
> cause I have to make it work today. I'm a little bit desperate right now.

You could build your own lazy loader inside your model like this:

/**
  * handled by extbase
  * @var integer
  */
protected $foo;

/**
  * not handled by extbase
  */
protected $fooObject = false;

public function getFoo() {
	if ($this->fooObject === false) {
		$repo = t3lib_div::makeInstance('...FooRepository');
		$this->fooObject = $repo->findByUid($this->foo);
	}
	return $this->fooObject;
}

> Thanks and best wishes,
> Thomas

Christian.


More information about the TYPO3-project-typo3v4mvc mailing list