Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Linux, php 5.2.10, apache 2.2.12
Description
I have this schema:
- Interface
Interfaz:
tableName: YT_INTERFAZ
columns:
cinterfaz: { type: integer, notnull: true, primary: true, autoincrement: true }relations:
Conexiones:
class: Interfaz
local: cinterfazsrc
foreign: cinterfazdst
refClass: Conexion
equal: true
#Link
Conexion:
tableName: YT_CONEXION
columns:
cinterfazsrc:
cinterfazdst:
{ type: integer, primary: true }When I try to get $interfaz->Conexiones, I get this message:
Notice: Undefined index: yt_interfaz in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 288
Notice: Undefined index: in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 289
Fatal error: Call to a member function getFieldName() on a non-object in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 290
But If I remove tableName fields in schema declaration, it works perfectly. The name of tableName don't matters, if you use it, it fails.
We've encountered this as well, tried a lot of different things in our models/schema to get around it, but nothing worked.
Made a test case here: https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php
Modified the doctrine core as suggested by Danny, but this change causes other Doctrine test to fail (Particularly tests/TableTestCase.php).