l3pp4rd/DoctrineExtensions — Issue #207: [Translatable] Query Hint: Fatal error: Nesting level too deep - recursive dependency?
Author: maff
Created: 2011-12-20 09:17:10+00:00
State: open

Hi,

I'm using the Translatable, Timestampable and Loggable extensions from the 2.1.x tag together with Doctrine 2.1.5. Translation basically works fine, but as soon as I use the Query Hint, I get the following Fatal error:

**Fatal error: Nesting level too deep - recursive dependency? in [...]/Doctrine/ORM/Query.php on line 603**

Stack trace:

```
[...]
8	1.4853	34574280	Doctrine\ORM\AbstractQuery->getResult( )	../IndexController.php:24
9	1.4853	34574672	Doctrine\ORM\AbstractQuery->execute( )	../AbstractQuery.php:413
10	1.4853	34574512	Doctrine\ORM\Query->_doExecute( )	../AbstractQuery.php:607
11	1.4853	34574512	Doctrine\ORM\Query->_parse( )	../Query.php:234
12	1.4853	34574592	Doctrine\ORM\Query->_getQueryCacheId( )	../Query.php:207
13	1.4853	34574752	var_export ( )	../Query.php:603
```

The code causing the error looks like the follwing (just a test query, but same behaviour on more complex queries):

```php
$select = "SELECT e FROM Entity\\Message e";
$query = $em->createQuery($select);
$query->setHint(
\Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER,
'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker'
);

Zend_Debug::dump($query->getDQL());
Zend_Debug::dump($query->getSQL());

$results = $query->getResult();
foreach ($results as $result) {
Zend_Debug::dump(array($result['id'], $result['title'], $result['content']));
}
```

Any ideas?

Regards,
Mathias