In Doctrine/Query.php change this line:

$q  = 'SELECT COUNT(DISTINCT ' . 
$this->getTableAlias($table->getTableName())

to:

$q  = 'SELECT COUNT(DISTINCT ' . $this->getTableAlias($componentAlias, 
$table->getTableName())

Which will fix your short alias exception, however, you may start to get 
"can't find relation 'id'" errors.  To fix those I had to remove this 
from my Generated model files (if you have any relationships setup in 
your YML file, the models may have this added to their "hasMany" and 
"hasOne" entries in the setup):

array('foreign' => 'id')

My app works again with these changes.  However, if I try to use the 
"counterpart" YML option for my Many to Many relationships, some odd 
things happen which I haven't figured out yet.  Without counterpart, 
everything is fine.

Jay

[EMAIL PROTECTED] wrote:
> Hi list,
>
> I have a problem with SfDoctrine plugin rev > 4129 : there seems to be
> a bug in the hydrating process where the "short alias" for a table
> could not be found.
> Here is the error triggered when displaying a pager in an auto
> generated backend :
>
> [Doctrine_Hydrate_Exception]
> Couldn't get short alias for members
> stack trace
>
>     * at ()
>       in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/
> Hydrate.php line 320 ...
>
>     * at Doctrine_Hydrate->getTableAlias('members')
>       in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/
> Query.php line 1132 ...
>
>     * at Doctrine_Query->count()
>       in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/
> sfDoctrinePager.class.php line 56 ...
>
>     * at sfDoctrinePager->init()
>       in SF_ROOT_DIR/cache/backend/dev/modules/autoMember/actions/
> actions.class.php line 44
>
>
> The problem lies in Doctrine/Query.php line 1132 :
> $q  = 'SELECT COUNT(DISTINCT ' . $this->getTableAlias($table-
>   
>> getTableName())
>>     
> But the getTableAlias method asks for 2 arguments, and throws an error
> if the second one is null ....
>
> Thank's for helping me solving this doctrine bug.
>
> F.
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to