<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 11:51:48 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DC-356/DC-356.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DC-356] Error in self referencing (nest relations) and tableName.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-356</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have this schema:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Interface&lt;br/&gt;
Interfaz: &lt;br/&gt;
  tableName:        YT_INTERFAZ&lt;br/&gt;
  columns:&lt;br/&gt;
    cinterfaz:        
{ type: integer, notnull: true, primary: true, autoincrement: true }
&lt;p&gt;  relations:&lt;br/&gt;
    Conexiones:&lt;br/&gt;
      class: Interfaz&lt;br/&gt;
      local: cinterfazsrc&lt;br/&gt;
      foreign: cinterfazdst&lt;br/&gt;
      refClass: Conexion&lt;br/&gt;
      equal: true&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;#Link&lt;br/&gt;
Conexion:&lt;br/&gt;
  tableName:        YT_CONEXION&lt;br/&gt;
  columns:&lt;br/&gt;
    cinterfazsrc:      &lt;/p&gt;
{ type: integer, primary: true }
&lt;p&gt;    cinterfazdst:      &lt;/p&gt;
{ type: integer, primary: true }

&lt;p&gt;When I try to get $interfaz-&amp;gt;Conexiones, I get this message:&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 289&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;

&lt;p&gt;But If I remove tableName fields in schema declaration, it works perfectly. The name of tableName don&apos;t matters, if you use it, it fails.&lt;/p&gt;</description>
                <environment>Linux, php 5.2.10, apache 2.2.12</environment>
            <key id="10609">DC-356</key>
            <summary>Error in self referencing (nest relations) and tableName.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="perseo">Sergio Gomez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Dec 2009 12:07:46 +0000</created>
                <updated>Thu, 17 Jan 2013 01:16:07 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15310" author="kweij" created="Tue, 15 Feb 2011 08:15:12 +0000"  >&lt;p&gt;Same story over here. Same error with the following non-equal nest relation:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;&amp;lt;?php

class TXCRDataNodeCRDataNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;x_CRDataNode_CRDataNode&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;childNodeID&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;parentNodeID&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setUp() {
        parent::setUp();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;TCRDataNode as child&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;childNodeID&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;dataNodeID&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;TCRDataNode as parent&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;parentNodeID&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;dataNodeID&apos;));
    }
}

class TCRDataNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;CRDataNode&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;dataNodeID&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;value&apos;, &apos;string&apos;, 255, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;length&apos; =&amp;gt; 255,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;TCRDataNode as childNodes&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;parentNodeID&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;childNodeID&apos;,
            &apos;refClass&apos; =&amp;gt; &apos;TXCRDataNodeCRDataNode&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;TCRDataNode as parentNodes&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;childNodeID&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;parentNodeID&apos;,
            &apos;refClass&apos; =&amp;gt; &apos;TXCRDataNodeCRDataNode&apos;));
    }
}

$dn = Doctrine_Core::getTable(&apos;TCRDataNode&apos;)-&amp;gt;find(5300);

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;.. and then when I ..&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;&amp;lt;?php

$pn = $dn-&amp;gt;parentNodes;

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;.. it goes like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice: Undefined index: crdatanode in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 288&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 289&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getFieldName() on a non-object in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 290&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Using Doctrine 1.2.2&lt;/p&gt;

&lt;p&gt;It seemed like the same thing as presented in the &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models:relationships:join-table-associations:self-referencing-nest-relations#non-equal-nest-relations&quot; class=&quot;external-link&quot;&gt;documentation&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15331" author="kweij" created="Thu, 17 Feb 2011 09:34:20 +0000"  >&lt;p&gt;This aching issue - as I traced the cord back to the wall - appears to originate from the fact that I use UPPERCASES in the names of my databas tables. When I user all lowercases: no problem. Hence it worked on my WAMP server (Windows just lowercases it all). Even when I so much as start the entity-table which an UPPERCASE: bang! Fatal error.&lt;/p&gt;

&lt;p&gt;This is not logical and, I presume, is a definite bug.&lt;/p&gt;

&lt;p&gt;Please, oh please fix this ..&lt;/p&gt;</comment>
                    <comment id="17528" author="dannykopping" created="Tue, 6 Mar 2012 08:39:37 +0000"  >&lt;p&gt;As Klaas mentions, this function incorrectly assumes that all databases will be named using lowercase letters.&lt;/p&gt;

&lt;p&gt;The problem arises in the following line:&lt;br/&gt;
$cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt; = $this-&amp;gt;_tableAliases&lt;span class=&quot;error&quot;&gt;&amp;#91;strtolower(implode(&amp;#39;__&amp;#39;, $e))&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;If one removes the &quot;strtolower&quot; function call, it will work for tables named with uppercase letters, but this is obviously quite an inelegant solution.&lt;/p&gt;

&lt;p&gt;Could you suggest an alternative solution? I&apos;ll be happy to make the change, test it and issue a pull request in GitHub&lt;/p&gt;</comment>
                    <comment id="17529" author="dannykopping" created="Tue, 6 Mar 2012 13:01:44 +0000"  >&lt;p&gt;I&apos;ve just tested this scenario in as many different possible combinations as I could think of (all tables uppercase/PascalCase, all tables lowercase, some Pascal, some lowercase) and just by removing the &quot;strtolower&quot; function, the issue seems to be resolved.&lt;/p&gt;</comment>
                    <comment id="19333" author="jklehr" created="Thu, 17 Jan 2013 01:16:07 +0000"  >&lt;p&gt;We&apos;ve encountered this as well, tried a lot of different things in our models/schema to get around it, but nothing worked.&lt;/p&gt;

&lt;p&gt;Made a test case here: &lt;a href=&quot;https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php&quot; class=&quot;external-link&quot;&gt;https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modified the doctrine core as suggested by Danny, but this change causes other Doctrine test to fail (Particularly tests/TableTestCase.php).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>