#1309: Association Table naming bug
------------------------+---------------------------------------------------
  Reporter:  quocbao    |       Owner:  romanb               
      Type:  defect     |      Status:  new                  
  Priority:  major      |   Milestone:  1.0.0-RC2            
 Component:  Relations  |     Version:  1.0                  
Resolution:             |    Keywords:                       
  Has_test:  1          |    Mystatus:  Pending Core Response
 Has_patch:  0          |  
------------------------+---------------------------------------------------
Comment (by quocbao):

 Here is another case :

 {{{
 Group:
   tableName: groups
   columns:
     group_id:
       name: group_id as Id
       type: integer(4)
       unsigned: 1
       primary: true
       autoincrement: true
       notnull: true
     group_name:
       name: group_name as Name
       type: string(250)
       notnull: true
     group_isroot:
       name: group_isroot as IsRoot
       type: boolean
       default: false
       notnull: true
   relations:
     Users:
       class: User
       local: group_id
       foreign: user_group
       type: many
     Roles:
       class: Role
       refClass: GroupRole
       local: group_id
       foreign: role_id
       type: many

 Role:
   tableName: roles
   columns:
     role_id:
       name: role_id as Id
       type: integer(4)
       unsigned: 1
       primary: true
       autoincrement: true
     role_name:
       name: role_name as Name
       type: string(250)
       notnull: true
     role_permissions:
       name: role_permissions as Permissions
       type: string(2147483647)
       notnull: true
   relations:
     Groups:
       class: Group
       local: role_id
       foreign: group_id
       refClass: GroupRole
       type: many

 GroupRole:
   tableName: group_role_rel
   columns:
     group_id:
       name: group_id
       type: integer(4)
       unsigned: 1
       primary: true
     role_id:
       name: role_id
       type: integer(4)
       unsigned: 1
       primary: true
 }}}

 When I use

 {{{
 $group->link('Roles',array($id1,$id2));
 }}}

 exception :

 {{{
 <b>Fatal error</b>:  Uncaught exception 'Doctrine_Record_Exception' with
 message 'Unknown record property / related component &quot;Id&quot; on
 &quot;GroupRole&quot;' in
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\pear\Doctrine\Record\Filter\Standard.php:44
 Stack trace:
 #0
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\pear\Doctrine\Record.php(952):
 Doctrine_Record_Filter_Standard-&gt;filterSet(Object(GroupRole), 'Id',
 '1')
 #1
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\pear\Doctrine\Access.php(133):
 Doctrine_Record-&gt;set('Id', '1')
 #2
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\pear\Doctrine\Record.php(1840):
 Doctrine_Access-&gt;offsetSet('Id', '1')
 #3
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\admin\controllers\siteadmin.php(252):
 Doctrine_Record-&gt;link('Roles', Array)
 #4
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\cms\core\controllers\action.php(103):
 SiteAdmin-&gt;EditGroup()
 #5
 
D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\admin\controllers\admin.php(84):
 ActionBasedController-&gt;execu in
 
<b>D:\xampp\htdocs\MegoCMS\branches\projects\m-mosaic.com\pear\Doctrine\Record\Filter\Standard.php</b>
 on line <b>44</b><br />
 }}}

 If I remove the alias "Id" of Group & Role model, everything works fine

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1309#comment:13>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to