<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 15:47:21 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/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+AND+fixVersion+%3D+%221.2.1%22&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DC+AND+fixVersion+%3D+%221.2.1%22</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="19" total="19"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-895] [I18n] Defining languages with locality (eg. en_GB) breaks functionality with SQL Integrity error - fix included</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-895</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When defining languages as language_COUNTRY codes (supported by symfony by default), the functionality to work with I18n records breaks, resulting in &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry&quot; errors.&lt;/p&gt;

&lt;p&gt;The reason is very simple: Doctrine&apos;s I18n language column is defined as a CHAR(2), thus shortening eg. &quot;en_GB&quot; value to &quot;en&quot;, thus causing the above SQL error when a &quot;en&quot; translation for a record already exists.&lt;/p&gt;

&lt;p&gt;The solution is even simpler: change the column&apos;s length to 7 in the Doctrine_I18n class&apos;s options: I&apos;ve tested this and all runs great: the correct SQL is being generated, the models behave correct, ...&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12019">DC-895</key>
            <summary>[I18n] Defining languages with locality (eg. en_GB) breaks functionality with SQL Integrity error - fix included</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="4levels">Erik Van Kelst</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Oct 2010 04:21:59 +0000</created>
                <updated>Wed, 20 Oct 2010 04:42:40 +0000</updated>
                    <resolved>Wed, 20 Oct 2010 04:42:40 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.0</fixVersion>
                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.3</fixVersion>
                                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14583" author="4levels" created="Wed, 20 Oct 2010 04:42:40 +0000"  >&lt;p&gt;Length of the i18n column is configurable...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-769] Variable type different for return value from Doctrine_Record-&gt;toArray() depending on whether the object is from a select, or a save.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-769</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With a object that is created via a save(),  and the record&apos;s primary key is a INT fed by a SEQUENCE, the type of the variable is an INT.&lt;/p&gt;

&lt;p&gt;With an object that is hydrated from the database via a SELECT, the record&apos;s primary key INT will come back in &apos;toArray()&apos; as a STRING.&lt;/p&gt;

&lt;p&gt;That means that checking for type has to know what context it came from, user, INSERT, or SELECT. Not fun.&lt;/p&gt;

&lt;p&gt;This also screws up converting arrays to JSON, &apos;cause the STRINGS get quotation marks and the INTS do not.&lt;/p&gt;

&lt;p&gt;As a general rule, everything FROM the database seems to be strings. Yes, I know, everything &apos;on the wire&apos; or &apos;through a socket&apos; comes out as text. And it&apos;s a lot faster to leave it that way.&lt;/p&gt;

&lt;p&gt;But having the type be different depending on the database operation? Not sure I like that.&lt;/p&gt;</description>
                <environment>Ubuntu9.10, PHP 5.2.6, Symfony 1.4.1, Postgres8.4</environment>
            <key id="11557">DC-769</key>
            <summary>Variable type different for return value from Doctrine_Record-&gt;toArray() depending on whether the object is from a select, or a save.</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="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Jun 2010 00:55:48 +0000</created>
                <updated>Tue, 24 Aug 2010 12:55:48 +0000</updated>
                                    <version>1.2.1</version>
                                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14050" author="jwage" created="Tue, 24 Aug 2010 12:02:06 +0000"  >&lt;p&gt;Can you provide a test case so that we can see if we can come up with a patch?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-764] Major-&gt;please.....Value of Primary key from sequence in Postgres table NOT being set (although sequence gets incremented)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-764</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the ERD/schema that I have set up, a couple levels down in hierarchal order, a table has 3 composite foreign keys, and one sequence of its own. That sequence does not get get set into the &apos;Table-&amp;gt;sequence variable&apos;. That means when the file &apos;UnitOfWork&apos; executes the function &apos;_assignSequence()&apos;, it finds no sequence name, and skips the assignment of the sequence value. &lt;/p&gt;

&lt;p&gt;This of course blows up my inserts.&lt;/p&gt;

&lt;p&gt;I have included the following documentation:&lt;/p&gt;

&lt;p&gt;A/ An installation and further description README.tx file.&lt;br/&gt;
B/ SQL script to generate a anonymous version of my ERD - I.E. the table names and column names have been changed to protect the guilty (and proprietary)&lt;br/&gt;
C/ A fixture file to load some data.&lt;br/&gt;
D/ A *.png file showing a graphical view of the ERD.&lt;br/&gt;
E/ The generated schema.yml file from ./symfony doctrine:build-schema&lt;br/&gt;
F/ A modifiled (has certain echo statements for troubleshooting purposes) UnitOfWork.php file.&lt;br/&gt;
G/ A task file to run that tries to load the schema with valid values.&lt;br/&gt;
H/ An output file from running the Task and modified UnitOfWork.php file showing the exact point of error during insert.&lt;/p&gt;

&lt;p&gt;Please let me know what I can do to help get this troubleshot quicly. Thx&lt;br/&gt;
E/ &lt;/p&gt;</description>
                <environment>Ubuntu9.10 / PHP 5.2.6-3ubuntu4.5 with Suhosin-Patch 0.9.6.2 / Postgres-8.4 / Symfony 1.4.1 </environment>
            <key id="11550">DC-764</key>
            <summary>Major-&gt;please.....Value of Primary key from sequence in Postgres table NOT being set (although sequence gets incremented)</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 20:51:13 +0000</created>
                <updated>Fri, 25 Jun 2010 18:00:37 +0000</updated>
                    <resolved>Fri, 25 Jun 2010 18:00:37 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.0</fixVersion>
                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.3</fixVersion>
                                <component>Connection</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13414" author="gearond" created="Fri, 25 Jun 2010 13:27:20 +0000"  >&lt;p&gt;Don&apos;t know if it&apos;s related, but I ran:&lt;/p&gt;

&lt;p&gt;./symfony doctrine:build-sql&lt;/p&gt;

&lt;p&gt;on the database in this bug report, and none of the tables got sequences assigned to them, nor default values set coming from a sequence.&lt;/p&gt;

&lt;p&gt;This is Postgres.&lt;/p&gt;</comment>
                    <comment id="13415" author="gearond" created="Fri, 25 Jun 2010 13:54:31 +0000"  >&lt;p&gt;So much for getting around this problem easily, &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I tried doing this:&lt;/p&gt;

&lt;p&gt;$e_table=Doctrine::getTable(&apos;E&apos;);&lt;br/&gt;
$e_table-&amp;gt;setOption(&apos;sequenceName&apos;, &apos;e_id&apos;);&lt;br/&gt;
$e_options=$e_table-&amp;gt;getOptions();&lt;br/&gt;
var_dump($e_options);&lt;/p&gt;

&lt;p&gt;before inserting a record into the &apos;E&apos; table. The option value &apos;sequenceName&apos; is in the option array and returns correctly. However, when doing an insert immediatley after the above code, I get:&lt;/p&gt;

&lt;p&gt;   &apos;sequence name was Array&apos; (from my troubleshooting &apos;echo&apos; statements in the modified UnitOfWork.php file)&lt;/p&gt;

&lt;p&gt;and the following errors: (you have to be using my modified UOW.php file to get the same line number there.)&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php on line 917&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2222&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2223&lt;br/&gt;
PREVIOUS line was processingSingleInsert&lt;/p&gt;

&lt;p&gt;Warning: Invalid argument supplied for foreach() in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 1151&lt;/p&gt;

&lt;p&gt;So I am wondering, does the public function table-&amp;gt;setOption();   even work, correclty that is?&lt;/p&gt;
</comment>
                    <comment id="13416" author="gearond" created="Fri, 25 Jun 2010 14:06:09 +0000"  >&lt;p&gt;If I instead just retrieve the next val of the sequence manually, change &apos;id&apos; column manually, then it works. But It then fails on the insert into the &apos;J&apos; table.&lt;/p&gt;

&lt;p&gt;Apparently, Doctrine does not like composite primary foreign keys with a sequence also part of the foreign key. I wonder if my file would work on the Oracle version?&lt;/p&gt;</comment>
                    <comment id="13417" author="gearond" created="Fri, 25 Jun 2010 17:57:39 +0000"  >&lt;p&gt;Showing simpler version of ERD/Schema converting Primary Foreign Keys to Foreign keys. The then required unique index on the former Primary Foreign Keys has not yet been coded. Just create it on all the keys in tables E and J, that were listed as primary in the first version in the zip file&lt;/p&gt;</comment>
                    <comment id="13418" author="gearond" created="Fri, 25 Jun 2010 18:00:37 +0000"  >&lt;p&gt;See last comment, but the short answer is . . . at this date, 2010-06-25, even Doctrine 2.0-DBAL can&apos;t do what I&apos;m trying to get verson 1.2.1 to do.&lt;/p&gt;

&lt;p&gt;So I got around it by converting primary foreign keys to foreign keys and then putting a unique index on the formerly primary keys.&lt;/p&gt;

&lt;p&gt;However, the child of the table treated that way, E(parent), J(child), now only has one foreign key, for E. To get all the ancestors, I will have to do subselects and joins. Oh well.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="10679" name="bugreport.zip" size="52298" author="gearond" created="Thu, 24 Jun 2010 20:51:13 +0000" />
                    <attachment id="10681" name="bug_report_create_postgresql.sql" size="7103" author="gearond" created="Fri, 25 Jun 2010 17:57:39 +0000" />
                    <attachment id="10680" name="schema.yml" size="5469" author="gearond" created="Fri, 25 Jun 2010 17:57:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-674] NULL Dates are translated to &apos;0000-00-00&apos; after upgrading to 1.2.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-674</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Once the upgrade was done from Doctrine 1.2.1 to 1.2.2 we discovered that date related issues started to appear.&lt;br/&gt;
With dates that are persisted in DB as NULL are translated to &quot;0000-00-00&quot; when retrieved from DB. This has occurred in multiple places and is quite worrying as there is a lot of dates in our project. This means that everywhere in our codebase where we check a datevalue in our Models is NULL we need also to check for the string literal &quot;0000-00-00&quot;.&lt;/p&gt;
</description>
                <environment>Zend Framework, Ubuntu 9.10, MySQL </environment>
            <key id="11343">DC-674</key>
            <summary>NULL Dates are translated to &apos;0000-00-00&apos; after upgrading to 1.2.2</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</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="villeit">Ville It&#228;maa</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 May 2010 07:59:54 +0000</created>
                <updated>Wed, 6 Oct 2010 06:29:40 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12895" author="jwage" created="Mon, 10 May 2010 12:19:21 +0000"  >&lt;p&gt;Are you able to reproduce this in a test case?&lt;/p&gt;</comment>
                    <comment id="12909" author="villeit" created="Tue, 11 May 2010 04:54:06 +0000"  >&lt;p&gt;We reverted to Doctrine 1.2.1 after realising the bug to confirm it was Doctrine 1.2.2 that was the cause for the problem. And as a result the records with NULL dates in the DB became NULL in the Models.&lt;br/&gt;
But when using Doctrine 1.2.2, the NULL dates became &apos;0000-00-00&apos; in the Models.&lt;br/&gt;
I don&apos;t have any other way to reproduce this error.&lt;/p&gt;</comment>
                    <comment id="12912" author="jwage" created="Tue, 11 May 2010 08:06:09 +0000"  >&lt;p&gt;Were you able to identity which changeset it was? You can read about creating test cases here &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So far I am not able to reproduce the error you described.&lt;/p&gt;</comment>
                    <comment id="13212" author="jwage" created="Tue, 8 Jun 2010 16:54:48 +0000"  >&lt;p&gt;I&apos;d like to fix this. Did you ever figure out which changeset introduced the issue? I&apos;ve been trying to figure it out myself.&lt;/p&gt;</comment>
                    <comment id="14535" author="hroland" created="Wed, 6 Oct 2010 06:29:30 +0000"  >&lt;p&gt;With 1.2.3 this works for me fine with both TIMESTAMP and DATE fields.&lt;/p&gt;


&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;YAML

        date_of_birth:
            type: date

BASE MODEL

        $this-&amp;gt;hasColumn(&apos;date_of_birth&apos;, &apos;date&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;date&apos;,

             // try these two
             // &apos;notnull&apos; =&amp;gt; false,
             // &apos;default&apos; =&amp;gt; null
         ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;YAML

        exported_at:
            type: timestamp(25)
            notnull: false
            default: null

            # in this model I have everything to make sure it accepts and defaults to NULL

BASE MODEL

        $this-&amp;gt;hasColumn(&apos;exported_at&apos;, &apos;timestamp&apos;, 25, array(
             &apos;type&apos; =&amp;gt; &apos;timestamp&apos;,
             &apos;notnull&apos; =&amp;gt; false,
             &apos;length&apos; =&amp;gt; &apos;25&apos;,
             ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You may try adding these to your YAML and (base) models&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;
YAML

    fieldname:
         . . .
        notnull: false
        default: null

BASE MODEL

        $this-&amp;gt;hasColumn(&apos;fieldname&apos;, . . .
             . . .
             &apos;notnull&apos; =&amp;gt; false, // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
             // &apos;default&apos; =&amp;gt; null, // &amp;lt;&amp;lt;&amp;lt; maybe, probably not needed
             ));

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I hope it helps.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-580] if deleting root with Doctrine_Node_NestedSet::delete() deletes all root nodes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-580</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Im using next code&lt;br/&gt;
			$category = Doctrine_Core::getTable(&apos;Mr_DirectoryTreeNodes&apos;)-&amp;gt;findOneBy(&apos;id&apos;,$params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
								$node = $category-&amp;gt;getNode();&lt;br/&gt;
								$node-&amp;gt;delete();&lt;/p&gt;

&lt;p&gt;Doctrine_Node_NestedSet::delete() deletes all root nodes;&lt;br/&gt;
_____________________&lt;/p&gt;

&lt;p&gt;to fix add &lt;/p&gt;

&lt;p&gt;$q = $q-&amp;gt;addWhere(&quot;$baseAlias.id = ?&quot;,  $this-&amp;gt;record-&amp;gt;get(&apos;id&apos;));&lt;/p&gt;

&lt;p&gt;after :&lt;/p&gt;

&lt;p&gt;$q = $q-&amp;gt;addWhere(&quot;$baseAlias.lft &amp;gt;= ? AND $baseAlias.rgt &amp;lt;= ?&quot;, array($this-&amp;gt;getLeftValue(), $this-&amp;gt;getRightValue()));&lt;/p&gt;
</description>
                <environment></environment>
            <key id="11076">DC-580</key>
            <summary>if deleting root with Doctrine_Node_NestedSet::delete() deletes all root nodes</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="micr">Michael</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Mar 2010 22:53:33 +0000</created>
                <updated>Wed, 17 Mar 2010 23:02:05 +0000</updated>
                    <resolved>Wed, 17 Mar 2010 23:02:05 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12313" author="micr" created="Wed, 17 Mar 2010 23:02:05 +0000"  >&lt;p&gt;with &lt;/p&gt;

&lt;p&gt;	public function setUp()&lt;br/&gt;
	&lt;/p&gt;
{
		$options = array(
            &apos;hasManyRoots&apos;     =&amp;gt; true,
            &apos;rootColumnName&apos;   =&amp;gt; &apos;root_id&apos;
        );
        
		$this-&amp;gt;actAs(&apos;Timestampable&apos;);
		$this-&amp;gt;actAs(&apos;NestedSet&apos;,$options);
		parent::setUp();
	}
&lt;p&gt;);&lt;/p&gt;

&lt;p&gt;it works propertly&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-553] issue when changing the connection inside Doctrine_Query::preQuery() on a model using a behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-553</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We were following:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/cookbook/1_1/en/master-and-slave-connections&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/cookbook/1_1/en/master-and-slave-connections&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;class MyQuery extends Doctrine_Query&lt;br/&gt;
{&lt;br/&gt;
    // Since php doesn&apos;t support late static binding in 5.2 we need to override&lt;br/&gt;
    // this method to instantiate a new MyQuery instead of Doctrine_Query&lt;br/&gt;
    public static function create($conn = null)&lt;/p&gt;
    {
        return new MyQuery($conn);
    }

&lt;p&gt;    public function preQuery()&lt;br/&gt;
    {&lt;br/&gt;
        // If this is a select query then set connection to one of the slaves&lt;br/&gt;
        if ($this-&amp;gt;getType() == Doctrine_Query::SELECT) &lt;/p&gt;
{
            $this-&amp;gt;_conn = Doctrine_Manager::getInstance()-&amp;gt;getConnection(&apos;slave_&apos; . rand(1, 4));
        // All other queries are writes so they need to go to the master
        }
&lt;p&gt; else &lt;/p&gt;
{
            $this-&amp;gt;_conn = Doctrine_Manager::getInstance()-&amp;gt;getConnection(&apos;master&apos;);
        }
&lt;p&gt;    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;However we are actually forcing all queries after the first access to the master to be run against the master (including selects). Note the example should probably be changed to use setConnection(). However even when using setConnection() it seems like changing the connection can cause issues when running a select on a model with a behavior (in our case we were using i18n). Therefore we believe there is some issue that is caused through the event system, because otherwise queries work just fine even when changing the connection as per the above described code.&lt;/p&gt;

&lt;p&gt;We managed to fix things, by not setting the connection explicitly and instead simply using setCurrentConnection(&apos;master&apos;), so the bug does not affect us anymore. However this seems to indicate some issues deep inside the event-behavior-template code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11006">DC-553</key>
            <summary>issue when changing the connection inside Doctrine_Query::preQuery() on a model using a behavior</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="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Mar 2010 11:18:28 +0000</created>
                <updated>Mon, 19 Jul 2010 07:45:41 +0000</updated>
                                                    <fixVersion>1.2.1</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12056" author="seldaek" created="Mon, 8 Mar 2010 11:26:13 +0000"  >&lt;p&gt;In case the above post is confusing, note that doing $this-&amp;gt;_conn = masterconn worked fine for the INSERT, it just broke when doing a subsequent SELECT  of a translateable (I18n behavior) model and its Translation table with the following exception:&lt;/p&gt;

&lt;p&gt;Exception (Exception): Unknown relation alias Translation (#0)&amp;lt;/h1&amp;gt;thrown in file /Library/WebServer/Documents/liip/infocube/ext/db-doctrine/lib/Doctrine/Relation/Parser.php at line 237&lt;br/&gt;
backtrace:&lt;br/&gt;
#1 Doctrine_Relation_Parser-&amp;gt;getRelation called in file /Library/WebServer/Documents/liip/infocube/ext/db-doctrine/lib/Doctrine/Relation/Parser.php at line 235&lt;/p&gt;</comment>
                    <comment id="12230" author="jwage" created="Mon, 15 Mar 2010 16:12:31 +0000"  >&lt;p&gt;It is hard to understand the issue, can you provide a test case?&lt;/p&gt;</comment>
                    <comment id="12241" author="lsmith" created="Mon, 15 Mar 2010 16:27:01 +0000"  >&lt;p&gt;We already spend well over 2 hours together on project time to find a work around as noted above and I must admit now our motivation is not so big to dig deeper, especially since we didn&apos;t find the cause in this time and have the feeling its pretty impossible to fix without huge risks.&lt;/p&gt;

&lt;p&gt;Essentially I think all you need to do to reproduce the issue is use the cookbook code &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; and issue some write query and afterwards do a select on a model that has the translatable behavior. It then gave us the above Exception.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Our code worked slightly different since we did not use a random slave, instead we always used a local slave by default, but the first write and any queries thereafter would get send to the master. The code is public and the diff&apos;s show what we had to change to get things working. Note that the slave &quot;localhost&quot; connection was the default connection:&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php?r1=13118&amp;amp;r2=&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php?r1=13118&amp;amp;r2=&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php?r1=13118&amp;amp;r2=&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php?r1=13118&amp;amp;r2=&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13348" author="lsmith" created="Thu, 17 Jun 2010 05:38:01 +0000"  >&lt;p&gt;we thought we had the issue fixed but ran into another issue today. we then noticed that the issue goes away if we just copy the $tables property from the old connection to the new connection. there is a getTables() method, but there is only a addTable() method, would be nice to have a addTables() method that is faster. or maybe a switchFrom() method that accepts the old connection and does whatever it needs to.&lt;/p&gt;

&lt;p&gt;And again it would be nice to update the cookbook entry.&lt;br/&gt;
Here are our updated Doctrine_Query and Doctrine_Record classes:&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13598" author="seldaek" created="Mon, 19 Jul 2010 07:45:41 +0000"  >&lt;p&gt;We just had another funny debugging session related to this. It turns out that the Table objects have a relation to the connection, and if you query a new model that wasn&apos;t initialized yet using -&amp;gt;from(), it works because it just gets the current connection passed. However, if you query a new model within a JOIN, then it apparently takes the connection from the related model you&apos;re joining from. In our case, the related model was already initialized but had an instance of the old (slave) connection, and so the new model was initialized using the wrong connection, and then the DQL parser exploded trying to resolve relations.&lt;/p&gt;

&lt;p&gt;Long story short, adding $table-&amp;gt;setConnection($conn); to all tables while switching to the master connection resolved it. The code is updated and you can still view it at the above URLs, or straight in the SVN repo at &lt;a href=&quot;http://svn.liip.ch/repos/public/okapi2/ext/db-doctrine/trunk/inc/DQ.php&quot; class=&quot;external-link&quot;&gt;http://svn.liip.ch/repos/public/okapi2/ext/db-doctrine/trunk/inc/DQ.php&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-528] CLONE -isValueModified returns true for timestamps that appear different but are equal</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-528</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is a copy of DC57: &lt;/p&gt;

&lt;p&gt;&quot;Doctrine_Record::isValueModified compares timestamps as strings and values that are equal such as 2009-09-02 00:00:00 and 2009-09-02 are treated as modified.&lt;/p&gt;

&lt;p&gt;The code should do a second compare on the strtotime value if the strings appear to be unequal.&quot; &lt;/p&gt;

&lt;p&gt;The changes made with this ticket causes problems with old timestamps because of strtotimes behaviour with dates before beginning of unix-period. I attached a diff for the original testcase to demonstrate the problem. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10968">DC-528</key>
            <summary>CLONE -isValueModified returns true for timestamps that appear different but are equal</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="floriank">Florian Klucke</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Feb 2010 09:24:38 +0000</created>
                <updated>Tue, 2 Mar 2010 13:26:59 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:26:59 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10397" name="DC57TestCase.diff" size="670" author="floriank" created="Fri, 26 Feb 2010 09:28:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-333] Doctrine_Migration_Diff reuses the same temporary folder on consecutive runs, resulting in collisions between projects</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-333</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;svn co &lt;a href=&quot;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&quot; class=&quot;external-link&quot;&gt;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&lt;/a&gt; cmstest13&lt;br/&gt;
cd cmstest13&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;edited config/doctrine/schema.yml and added a trivial table so there would be something at the app level&amp;#93;&lt;/span&gt;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;successful doctrine:build --all followed&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;./symfony doctrine:generate-migrations-diff&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  generating migration diff&lt;br/&gt;
&amp;gt;&amp;gt; file+     /private/var/folders/3H/3Hu3TTyjFt...TI/&lt;del&gt;Tmp&lt;/del&gt;/doctrine_schema_15549.yml&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;EventUser&apos; not found in /private/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/&lt;del&gt;Tmp&lt;/del&gt;/fromprfx_doctrine_tmp_dirs/base/BaseEventGuest.class.php on line 7&lt;/p&gt;

&lt;p&gt;I recognize my personal temp folder from my environment in there:&lt;/p&gt;

&lt;p&gt;TMPDIR=/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/&lt;del&gt;Tmp&lt;/del&gt;/&lt;/p&gt;

&lt;p&gt;So presumably these tasks are supposed to clean it up after they use it. But none of my attempts to use this task so far have succeeded, so I suspect the problem is that the folder does not get cleaned up in the event of an error. This folder needs to get cleaned up on all errors, or perhaps cleared at the start of a new run (that is probably going to turn out to be a more reliable fix).&lt;/p&gt;

&lt;p&gt;I&apos;ll manually clear it and move on to the bug I was originally looking to reproduce.&lt;/p&gt;</description>
                <environment>Symfony 1.3 with MacPorts PHP 5.3.1</environment>
            <key id="10576">DC-333</key>
            <summary>Doctrine_Migration_Diff reuses the same temporary folder on consecutive runs, resulting in collisions between projects</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Dec 2009 18:35:53 +0000</created>
                <updated>Mon, 7 Dec 2009 21:29:50 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 21:29:50 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11054" author="jwage" created="Mon, 7 Dec 2009 19:37:53 +0000"  >&lt;p&gt;Hmm. When I look at Doctrine_Migration_Diff we implement a _cleanup() method that is for that purpose. Does it not clean up the directory properly?&lt;/p&gt;</comment>
                    <comment id="11058" author="boutell" created="Mon, 7 Dec 2009 19:51:11 +0000"  >&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Peeks at source&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Looks like you do it last. If an exception is thrown it doesn&apos;t happen (I just verified that I have a full folder of classes left behind after an attempt to use it). Then you have a lingering problem confounding your attempts to try again. &lt;/p&gt;

&lt;p&gt;Suggest you call _cleanup() at the start and the end. The first call won&apos;t take much time at all if the last run was a happy one. If it was an unhappy one you really need it.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;* *&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;A much more minor issue:&lt;/p&gt;

&lt;p&gt;I&apos;m a little nervous about the fact that if I were running two schema diffs for two different projects at once, they would still collide, sharing the same tmp folder. I would suggest starting everything from TMP/doctrine-$pid where $pid = getpid() or something like that.&lt;/p&gt;

&lt;p&gt;In pkToolkit we use SF_ROOT_DIR/data/pk_writable/tmp because that is safely project-specific. &lt;/p&gt;</comment>
                    <comment id="11060" author="jwage" created="Mon, 7 Dec 2009 19:58:10 +0000"  >&lt;p&gt;Tom, as you have an environment setup with the problem exposed, could you prepare a patch that fixes the problems you are encountering?&lt;/p&gt;</comment>
                    <comment id="11068" author="jwage" created="Mon, 7 Dec 2009 21:18:48 +0000"  >&lt;p&gt;So I just want to confirm. We have two issues now. The _cleanup() method needs to be called when it starts. This patch should take care of that:&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-java&quot;&gt;Index: lib/Doctrine/Migration/Diff.php
===================================================================
--- lib/Doctrine/Migration/Diff.php	(revision 6882)
+++ lib/Doctrine/Migration/Diff.php	(working copy)
@@ -93,6 +93,8 @@
      */
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function generateChanges()
     {
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_cleanup();
+
         $from = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(self::$_fromPrefix, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_from);
         $to = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(self::$_toPrefix, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_to);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we have another issue where the paths could conflict. Can we open another ticket to work on that issue? Can you confirm that the above patch fixes this individual issue?&lt;/p&gt;</comment>
                    <comment id="11069" author="boutell" created="Mon, 7 Dec 2009 21:24:53 +0000"  >&lt;p&gt;Yes that is the correct patch, I just prepared the exact same patch and went back to my email to find the ticket and saw your comment.&lt;/p&gt;

&lt;p&gt;I will open a separate ticket re: the potential clash between projects. It&apos;s certainly less probable but it doesn&apos;t make sense for them to contend for a single folder.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="11071" author="jwage" created="Mon, 7 Dec 2009 21:27:28 +0000"  >&lt;p&gt;Cool. Yes I think we can fix the other issue but in another revision/ticket. I will go ahead and commit that patch and close this ticket.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-330] Doctrine_Table unshiftFilter() expects method Doctrine_Record_Filter init()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-330</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;That method is not defined in Doctrine_Record_Filter either as abstract or with empty implementation, only in Doctrine_Record_Filter_Compound.&lt;/p&gt;

&lt;p&gt;Doctrine_Record_Filter_Standard seems to get around this by not being registered via unshiftFilter()&lt;/p&gt;</description>
                <environment>Windows, PHP 5.2.9-2</environment>
            <key id="10567">DC-330</key>
            <summary>Doctrine_Table unshiftFilter() expects method Doctrine_Record_Filter init()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathancollins">Jonathan Collins</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Dec 2009 20:49:43 +0000</created>
                <updated>Mon, 7 Dec 2009 18:26:10 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 18:26:10 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10215" name="DC-330-Doctrine_Record_Filter.patch" size="504" author="jonathancollins" created="Sat, 5 Dec 2009 20:55:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-317] Using NestedSet behavior, createRoot function doesn&apos;t behave as expected with string multiple root key</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-317</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have defined this model :&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-java&quot;&gt; 
Page:
  options: { type: InnoDB, collate: utf8_unicode_ci, charset: utf8 }
  columns:
    topic:       { type: string(32), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    title:        { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
  actAs:
    NestedSet:      { hasManyRoots: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, rootColumnName: topic }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And use this code (database is empty) :&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-java&quot;&gt;&amp;lt;?

$page = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Page;
$page-&amp;gt;topic = &apos;my-topic&apos;;
$page-&amp;gt;title = &apos;My Title&apos;;
$page-&amp;gt;save();

print_r( $page-&amp;gt;topic );  &lt;span class=&quot;code-comment&quot;&gt;// OK, here it&apos;s perfect
&lt;/span&gt;
Doctrine::getTable(&apos;Page&apos;)-&amp;gt;getTree()-&amp;gt;createRoot( $page );

print_r( $page-&amp;gt;topic ); &lt;span class=&quot;code-comment&quot;&gt;// Now topic == 1 . It&apos;s buggy !
&lt;/span&gt;

Doctrine::getTable(&apos;Page&apos;)-&amp;gt;getTree()-&amp;gt;fetchTree( &apos;my-topic&apos; ); &lt;span class=&quot;code-comment&quot;&gt;// Buggy : &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !
&lt;/span&gt;
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;



&lt;p&gt;Let me know if you need more explainations,&lt;br/&gt;
julien&lt;/p&gt;</description>
                <environment>Using Symfony 1.4 and  MySQL</environment>
            <key id="10554">DC-317</key>
            <summary>Using NestedSet behavior, createRoot function doesn&apos;t behave as expected with string multiple root key</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="julien">Julien G</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 14:19:38 +0000</created>
                <updated>Mon, 7 Dec 2009 20:34:19 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 20:34:19 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Behaviors</component>
                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-314] length option ignored in addColumn method in Doctrine 1.2 migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-314</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using &lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib&quot; class=&quot;external-link&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib&lt;/a&gt; and saw this problem with revision 6806.&lt;/p&gt;

&lt;p&gt;The &apos;length&apos; parameter in the options array seems to be&lt;br/&gt;
ignored by addColumn in Doctrine 1.2 migrations. No matter what we specified for&lt;br/&gt;
&apos;length&apos; we got a bigint in MySQL, resulting in failure later when we&lt;br/&gt;
tried to add a foreign key because we needed a 4-byte integer. There&lt;br/&gt;
does not seem to be any documentation of what is valid in the options&lt;br/&gt;
array when calling addColumn, however I see that length is still used&lt;br/&gt;
when passing an apparently identical options array for a particular&lt;br/&gt;
column when calling createTable. &lt;/p&gt;

&lt;p&gt;That is, this code:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;pg_event_request&apos;, &apos;event_id&apos;, &apos;integer&apos;,&lt;br/&gt;
array(&apos;length&apos; =&amp;gt; 4));&lt;/p&gt;

&lt;p&gt;Does not work properly in Doctrine 1.2 (you get a bigint in MySQL).&lt;/p&gt;

&lt;p&gt;We were able to work around it by implementing a migrate() method&lt;br/&gt;
instead, passing 4 as the final argument (there doesn&apos;t seem to be&lt;br/&gt;
clear documentation of this final argument but in the example in the&lt;br/&gt;
documentation it is the length of a string column, and sure enough it&lt;br/&gt;
does the same thing for an integer). Passing 4 here worked, we got a&lt;br/&gt;
4-byte integer.&lt;/p&gt;</description>
                <environment>Symfony 1.3</environment>
            <key id="10549">DC-314</key>
            <summary>length option ignored in addColumn method in Doctrine 1.2 migrations</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 16:58:45 +0000</created>
                <updated>Wed, 2 Dec 2009 17:12:28 +0000</updated>
                    <resolved>Wed, 2 Dec 2009 17:12:28 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10973" author="jwage" created="Wed, 2 Dec 2009 17:12:28 +0000"  >&lt;p&gt;I just fixed this here hehe&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6842&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6842&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, the function signature in 1.2 is:&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-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addColumn($tableName, $columnName, $type, $length = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array $options = array())
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It has the $length argument, but you can still pass the length via the options. In the end all that information is just in one array.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-308] Doctrine is throwing base and not project-level Exceptions </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-308</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Files (without locations, easy to find):&lt;/p&gt;

&lt;p&gt;Doctrine_Adapter_Statement_Oracle&lt;br/&gt;
replace to Doctrine_Adapter_Exception&lt;/p&gt;

&lt;p&gt;Doctrine_Node_NestedSet&lt;br/&gt;
replace to Doctrine_Node_Exception&lt;/p&gt;

&lt;p&gt;sfYamlInline from Doctrine\Parser\sfYaml&lt;br/&gt;
replace with InvalidArgumentException&lt;/p&gt;</description>
                <environment></environment>
            <key id="10539">DC-308</key>
            <summary>Doctrine is throwing base and not project-level Exceptions </summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 19:29:48 +0000</created>
                <updated>Tue, 1 Dec 2009 22:10:34 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 22:08:21 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10958" author="jwage" created="Tue, 1 Dec 2009 19:45:51 +0000"  >&lt;p&gt;It would be much easier with patches &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10959" author="juokaz" created="Tue, 1 Dec 2009 19:47:45 +0000"  >&lt;p&gt;One second&lt;/p&gt;</comment>
                    <comment id="10960" author="jwage" created="Tue, 1 Dec 2009 19:50:20 +0000"  >&lt;p&gt;Actually, do you have a trac account? I can give you SVN access and you can commit the changes yourself. But, you must create tickets before committing anything and get approval from someone before committing. Allowing you to commit directly will just ease the process a little.&lt;/p&gt;</comment>
                    <comment id="10961" author="juokaz" created="Tue, 1 Dec 2009 19:57:16 +0000"  >&lt;p&gt;Attached patches (sfYaml is separate, Tortoise refused to do otherwise)&lt;/p&gt;

&lt;p&gt;I don&apos;t have trac account, but I&apos;m interested in contributing more since I work with Doctrine day and night &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10962" author="jwage" created="Tue, 1 Dec 2009 20:13:36 +0000"  >&lt;p&gt;I sent you an e-mail about SVN access.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10199" name="doctrine.patch" size="1789" author="juokaz" created="Tue, 1 Dec 2009 19:57:16 +0000" />
                    <attachment id="10198" name="sfyaml.patch" size="566" author="juokaz" created="Tue, 1 Dec 2009 19:57:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-307] Oracle adapter statement is not behavin correctly when error mode is Doctrine_Core::ERRMODE_SILENT or Doctrine_Core::ERRMODE_WARNING</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-307</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Fetch column method looks like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;public function fetchColumn($columnIndex = 0)&lt;br/&gt;
{&lt;br/&gt;
	if ( ! is_integer($columnIndex)) {&lt;br/&gt;
		$this-&amp;gt;handleError(array(&apos;message&apos;=&amp;gt;&quot;columnIndex parameter should be numeric&quot;));&lt;br/&gt;
	}&lt;br/&gt;
	$row = $this-&amp;gt;fetch(Doctrine_Core::FETCH_NUM);&lt;br/&gt;
	return $row&lt;span class=&quot;error&quot;&gt;&amp;#91;$columnIndex&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Method handleError() not always throws an exception, and by passing it a string or any other variable type than integer will result in warning.&lt;/p&gt;

&lt;p&gt;Fix (depending on what is considered to be required by interface):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if ( ! is_integer($columnIndex)) {&lt;br/&gt;
	$this-&amp;gt;handleError(array(&apos;message&apos;=&amp;gt;&quot;columnIndex parameter should be numeric&quot;));&lt;br/&gt;
       return false;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if ( ! is_integer($columnIndex)) {&lt;br/&gt;
	throw new Doctrine_Adapter_Exception(&quot;columnIndex parameter should be numeric&quot;);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;
</description>
                <environment></environment>
            <key id="10538">DC-307</key>
            <summary>Oracle adapter statement is not behavin correctly when error mode is Doctrine_Core::ERRMODE_SILENT or Doctrine_Core::ERRMODE_WARNING</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 19:03:41 +0000</created>
                <updated>Tue, 1 Dec 2009 19:17:17 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:15:10 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10953" author="juokaz" created="Tue, 1 Dec 2009 19:04:47 +0000"  >&lt;p&gt;Fixed code comments&lt;/p&gt;</comment>
                    <comment id="10954" author="jwage" created="Tue, 1 Dec 2009 19:11:24 +0000"  >&lt;p&gt;I don&apos;t quite understand what you are wanting me to change here. can you explain?&lt;/p&gt;</comment>
                    <comment id="10955" author="jwage" created="Tue, 1 Dec 2009 19:13:53 +0000"  >&lt;p&gt;Nevermind, I understand. I think returning false is probably the right choice, don&apos;;t you think?&lt;/p&gt;</comment>
                    <comment id="10956" author="juokaz" created="Tue, 1 Dec 2009 19:15:10 +0000"  >&lt;p&gt;If I pass:&lt;/p&gt;

&lt;p&gt;fetchColumn(&apos;test&apos;) &lt;/p&gt;

&lt;p&gt;and the error level is set like above, this code will generate php notice, because you will be trying:&lt;/p&gt;

&lt;p&gt;return $row&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;test&amp;#39;&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;So the problem is - when handleError() is not throwing exception, check is_integer() is almost ignored.&lt;/p&gt;</comment>
                    <comment id="10957" author="juokaz" created="Tue, 1 Dec 2009 19:17:17 +0000"  >&lt;p&gt;I would say false is correct. Although it depends on what interface is expecting.&lt;/p&gt;

&lt;p&gt;I don&apos;t know about Oracle, but some RDBMS support boolean types and false can be a value too, so when you are returning false here, in user code it would be hard to detect a problem. (although it&apos;s hardly plausible) &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-306] Oracle adapter statement is referencing non-existing constants</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-306</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Line 316 in Doctrine/Adatper/Statement/Oracle.php has:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;case FETCH_OBJ:&lt;br/&gt;
	return oci_fetch_object($this-&amp;gt;statement, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);&lt;br/&gt;
break;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;There is no constant FETCH_OBJ, so line should be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;case Doctrine_Core::FETCH_OBJ:&lt;br/&gt;
	return oci_fetch_object($this-&amp;gt;statement, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);&lt;br/&gt;
break;&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="10537">DC-306</key>
            <summary>Oracle adapter statement is referencing non-existing constants</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 18:59:07 +0000</created>
                <updated>Tue, 1 Dec 2009 19:05:15 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:05:15 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-305] Oracle adapter statement closeCursor() is not working properly</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-305</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Close cursor method cleans up non-existing array &lt;b&gt;$bind_params&lt;/b&gt;, correct variable name is &lt;b&gt;$bindParams&lt;/b&gt;. (comment of $bindParams is wrong to because it also speaks about $bind_params)&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;public function closeCursor()&lt;br/&gt;
{&lt;br/&gt;
	$this-&amp;gt;bind_params = array();&lt;br/&gt;
	return oci_free_statement($this-&amp;gt;statement);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Fix:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;public function closeCursor()&lt;br/&gt;
{&lt;br/&gt;
	$this-&amp;gt;bindParams = array();&lt;br/&gt;
	return oci_free_statement($this-&amp;gt;statement);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="10536">DC-305</key>
            <summary>Oracle adapter statement closeCursor() is not working properly</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 18:48:43 +0000</created>
                <updated>Tue, 1 Dec 2009 19:09:01 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:09:01 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-304] Auloader returns false even though sfYaml* class is loaded</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-304</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Autoloader loads method has lines:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if (0 !== stripos($className, &apos;Doctrine_&apos;) || class_exists($className, false) || interface_exists($className, false)) {&lt;br/&gt;
	return false;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Which for sfYaml classes always are true (0 !== stripos(&apos;sfYaml&apos;, &apos;Doctrine_&apos;) ==&amp;gt; true) and hence autoloader returns false. This creates problems if there are more than one autoloader in the stack.&lt;/p&gt;

&lt;p&gt;Fix:&lt;/p&gt;

{qupte}
&lt;p&gt;if (strpos($className, &apos;sfYaml&apos;) === 0) &lt;/p&gt;
{
	require dirname(__FILE__) . &apos;/Parser/sfYaml/&apos; . $className . &apos;.php&apos;;
	
	return true;
}
{quote}</description>
                <environment></environment>
            <key id="10535">DC-304</key>
            <summary>Auloader returns false even though sfYaml* class is loaded</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 18:44:21 +0000</created>
                <updated>Tue, 1 Dec 2009 19:06:46 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:06:46 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-302] Issues when using automatic relations ordering through &apos;orderBy&apos; param in m2m relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-302</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Partially related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-240&quot; title=&quot;Automatic ordering through orderBy in many-to-many relation definition issue&quot;&gt;&lt;del&gt;DC-240&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I found some additional problems, mainly with self-referenced relations.&lt;br/&gt;
I use ACL system with multiple inheritance, where order of inherited elements matters. &lt;br/&gt;
Here we have (Role &amp;lt;- m2m orderBy position - &amp;gt; Role) and (User &amp;lt; - m2m orderBy position -&amp;gt; Role):&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-java&quot;&gt;class Role &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; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 64);
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;User as Users&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_user&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Parents&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;refClass&apos; =&amp;gt; &apos;RoleReference&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Children&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;refClass&apos; =&amp;gt; &apos;RoleReference&apos;));
	}
}

class RoleReference &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; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role_parent&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role_child&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;position&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role as Parent&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role as Child&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}

class User &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; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;username&apos;, &apos;string&apos;, 64, array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;password&apos;, &apos;string&apos;, 128, array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Roles&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
	}
}

class UserRole &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; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_user&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;position&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;User&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sample data:&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-java&quot;&gt;$role1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role1-&amp;gt;name = &apos;admin&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 1
&lt;/span&gt;$role1-&amp;gt;save();

$role2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role2-&amp;gt;name = &apos;publisher&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 2
&lt;/span&gt;$role2-&amp;gt;save();

$role3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role3-&amp;gt;name = &apos;reviewer&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 3
&lt;/span&gt;$role3-&amp;gt;save();

$role4 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role4-&amp;gt;name = &apos;mod&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 4
&lt;/span&gt;$role4-&amp;gt;save();

&lt;span class=&quot;code-comment&quot;&gt;// reviewer inherits from admin, mod, publisher - in that order
&lt;/span&gt;$role3-&amp;gt;Parents[] = $role1;
$role3-&amp;gt;Parents[] = $role4;
$role3-&amp;gt;Parents[] = $role2;
$role3-&amp;gt;save();

&lt;span class=&quot;code-comment&quot;&gt;// update positions
&lt;/span&gt;$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;RoleReference&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 0)
	-&amp;gt;where(&apos;id_role_child = ?&apos;, 3)
	-&amp;gt;andWhere(&apos;id_role_parent = ?&apos;, 1)
	-&amp;gt;execute();
$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;RoleReference&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 1)
	-&amp;gt;where(&apos;id_role_child = ?&apos;, 3)
	-&amp;gt;andWhere(&apos;id_role_parent = ?&apos;, 4)
	-&amp;gt;execute();
$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;RoleReference&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 2)
	-&amp;gt;where(&apos;id_role_child = ?&apos;, 3)
	-&amp;gt;andWhere(&apos;id_role_parent = ?&apos;, 2)
	-&amp;gt;execute();
	

&lt;span class=&quot;code-comment&quot;&gt;// add test user
&lt;/span&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;username = &apos;test&apos;;
$user-&amp;gt;password = &apos;test&apos;;
$user-&amp;gt;fromArray(array(&apos;Roles&apos; =&amp;gt; array(4, 2)));
$user-&amp;gt;save();
&lt;span class=&quot;code-comment&quot;&gt;// update positions
&lt;/span&gt;$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;UserRole&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 0)
	-&amp;gt;where(&apos;id_user = ?&apos;, 1)
	-&amp;gt;andWhere(&apos;id_role = ?&apos;, 4)
	-&amp;gt;execute();
$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;UserRole&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 1)
	-&amp;gt;where(&apos;id_user = ?&apos;, 1)
	-&amp;gt;andWhere(&apos;id_role = ?&apos;, 2)
	-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Now, lazy-loading self-referenced m2m relations seems to be the issue (I know lazy-loading is wrong but it&apos;s needed to be like that in some parts of our system):&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-java&quot;&gt;$role = Doctrine::getTable(&apos;Role&apos;)-&amp;gt;find(3);
print_r($role-&amp;gt;Parents-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The query which is created and executed during lazy-load of Parents relations is as follows:&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-java&quot;&gt;SELECT role.id AS role__id, role.name AS role__name, role_reference.id_role_parent AS role_reference__id_role_parent, role_reference.id_role_child AS role_reference__id_role_child, role_reference.position AS role_reference__position FROM role INNER JOIN role_reference ON role.id = role_reference.id_role_parent WHERE role.id IN (SELECT id_role_parent FROM role_reference WHERE id_role_child = ?) ORDER BY role.id ASC, position
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(seems a little strange as there are no automatically generated aliases e.g. r1, r2 etc. but whole table names)&lt;br/&gt;
The result is ordered by role.id first, then by position (without any alias and that could be an additional problem in some cases)&lt;/p&gt;

&lt;p&gt;The result is: (as you can see the order of roles is 1, 2, 4 (positions: 0, 2, 1) instead of 1, 4, 2)&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-java&quot;&gt;Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 1
            [name] =&amp;gt; admin
            [RoleReference] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [id_role_parent] =&amp;gt; 1
                            [id_role_child] =&amp;gt; 3
                            [position] =&amp;gt; 0
                            [Parent] =&amp;gt; 
                        )

                )

        )

    [1] =&amp;gt; Array
        (
            [id] =&amp;gt; 2
            [name] =&amp;gt; publisher
            [RoleReference] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [id_role_parent] =&amp;gt; 2
                            [id_role_child] =&amp;gt; 3
                            [position] =&amp;gt; 2
                            [Parent] =&amp;gt; 
                        )

                )

        )

    [2] =&amp;gt; Array
        (
            [id] =&amp;gt; 4
            [name] =&amp;gt; mod
            [RoleReference] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [id_role_parent] =&amp;gt; 4
                            [id_role_child] =&amp;gt; 3
                            [position] =&amp;gt; 1
                            [Parent] =&amp;gt; 
                        )

                )

        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is NOT an issue with lazy-loading m2m relations between two different models:&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-java&quot;&gt;$user = Doctrine::getTable(&apos;User&apos;)-&amp;gt;find(1);
print_r($user-&amp;gt;Roles-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The query generated seems to be correct: (well &lt;b&gt;except&lt;/b&gt; the lack of an alias in front of position column in ORDER BY clause)&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-java&quot;&gt;SELECT `r`.`id` AS `r__id`, `r`.`name` AS `r__name`, `u`.`id_user` AS `u__id_user`, `u`.`id_role` AS `u__id_role`, `u`.`position` AS `u__position` FROM `role` `r` LEFT JOIN `user_role` `u` ON `r`.`id` = `u`.`id_role` WHERE (`u`.`id_user` IN (?)) ORDER BY position
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It works well for self-referenced relations where relation are defined in DQL e.g.:&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-java&quot;&gt;$query = Doctrine_Query::create()
	-&amp;gt;from(&apos;Role r&apos;)
	-&amp;gt;leftJoin(&apos;r.Parents rp&apos;)
	-&amp;gt;orderBy(&apos;r.name ASC&apos;)
	-&amp;gt;where(&apos;r.id = ?&apos;, 3);
	
var_dump($query-&amp;gt;getSqlQuery());
$result = $query-&amp;gt;fetchOne();

print_r($result-&amp;gt;Parents-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;To sum up:&lt;br/&gt;
1. orderBy in m2m self-referenced relations does not work when they are lazy-loaded&lt;br/&gt;
2. lack of table alias for orderBy column when lazy-loading m2m relations between separate models (possibly not an issue?)&lt;/p&gt;

&lt;p&gt;I am not sure if the first one could be fixed at all, due to specific query construction? If not, I would be glad to see a possible workaround for this problem.&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description>
                <environment>php 5.3/win, doctrine 1.2 svn, ATTR_QUOTE_IDENTIFIER = true, ATTR_USE_DQL_CALLBACKS = true</environment>
            <key id="10533">DC-302</key>
            <summary>Issues when using automatic relations ordering through &apos;orderBy&apos; param in m2m relations</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 14:39:18 +0000</created>
                <updated>Tue, 1 Dec 2009 19:03:23 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:03:23 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10946" author="mh" created="Tue, 1 Dec 2009 18:01:16 +0000"  >&lt;p&gt;Attached test case. I did not know how to test the second issue - is there a db profiler available during unit testing?&lt;/p&gt;</comment>
                    <comment id="10952" author="jwage" created="Tue, 1 Dec 2009 19:03:23 +0000"  >&lt;p&gt;Thanks for the report and test case. I made a change and your test case passes now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10197" name="DC302TestCase.php" size="6926" author="mh" created="Tue, 1 Dec 2009 18:01:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-298] Doctrine_Cache_Driver : array_search() expects parameter 2 to be array, boolean given at line 283</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-298</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Cache_Driver::fetch() is supposed to return a string, but an array_search() is made on it by Doctrine_Cache_Driver::_deleteKey() (at line 283).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10521">DC-298</key>
            <summary>Doctrine_Cache_Driver : array_search() expects parameter 2 to be array, boolean given at line 283</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="theredled">Beno&#238;t Guchet</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Nov 2009 15:03:59 +0000</created>
                <updated>Tue, 1 Dec 2009 19:19:27 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:19:27 +0000</resolved>
                            <version>1.2.0-RC1</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10907" author="jwage" created="Mon, 30 Nov 2009 15:52:19 +0000"  >&lt;p&gt;I don&apos;t quite understand. Can you explain more?&lt;/p&gt;</comment>
                    <comment id="10913" author="jwage" created="Mon, 30 Nov 2009 17:11:48 +0000"  >&lt;p&gt;Reading your description it doesn&apos;t make any sense. Re-open if you have a better more clear description of the problem.&lt;/p&gt;</comment>
                    <comment id="10915" author="theredled" created="Mon, 30 Nov 2009 17:19:58 +0000"  >&lt;p&gt;It&apos;s not very complicated :&lt;/p&gt;

&lt;p&gt;In Doctrine_Cache_Driver::_deleteKey, you do array_search() with the array $keys as haystack:&lt;/p&gt;

&lt;p&gt;        $keys = $this-&amp;gt;fetch($this-&amp;gt;_cacheKeyIndexKey);&lt;br/&gt;
        $key = array_search($key, $keys);&lt;/p&gt;

&lt;p&gt;But $keys is a string, because Doctrine_Cache_Driver::fetch returns a string (or false) :&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Fetch a cache record from this cache driver instance&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param string $id cache id&lt;/li&gt;
	&lt;li&gt;@param boolean $testCacheValidity        if set to false, the cache validity won&apos;t be tested&lt;/li&gt;
	&lt;li&gt;@return string cached datas (or false)&lt;br/&gt;
     */&lt;br/&gt;
    public function fetch($id, $testCacheValidity = true)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You can&apos;t make an array_search on a string.&lt;/p&gt;

&lt;p&gt;I can&apos;t be more clear &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;


&lt;p&gt;edit : You may tell me that the PHPdoc is wrong : but the problem still appears when ::fetch returns false.&lt;/p&gt;</comment>
                    <comment id="10917" author="jwage" created="Mon, 30 Nov 2009 17:30:47 +0000"  >&lt;p&gt;The api documentation is wrong, fetch always returns the data structure that was originally stored. So in this case it is an array.&lt;/p&gt;</comment>
                    <comment id="10918" author="theredled" created="Mon, 30 Nov 2009 17:32:30 +0000"  >&lt;p&gt;Ok i&apos;ve anticipated this answer &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;So Cf. edit of my last comment.&lt;/p&gt;</comment>
                    <comment id="10919" author="jwage" created="Mon, 30 Nov 2009 17:32:31 +0000"  >&lt;p&gt;I updated the API doc blocks.&lt;/p&gt;</comment>
                    <comment id="10939" author="theredled" created="Tue, 1 Dec 2009 13:08:07 +0000"  >&lt;p&gt;Sorry, I reopen this issue again because I still encounter it.&lt;/p&gt;

&lt;p&gt;I&apos;ve watched it deeper to make it reproductible : &lt;/p&gt;

&lt;p&gt;I&apos;m using Doctrine_Cache_Array.&lt;br/&gt;
The problem simply appears when you try to delete a cache entry that does not exist.&lt;/p&gt;

&lt;p&gt;example :&lt;/p&gt;

&lt;p&gt;    $cache = new Doctrine_Cache_Array();&lt;br/&gt;
    $cache-&amp;gt;delete(45);&lt;/p&gt;
</comment>
                    <comment id="10940" author="theredled" created="Tue, 1 Dec 2009 13:29:58 +0000"  >&lt;p&gt;Patch to Doctrine_Cache_Array::_doDelete() so that it returns false if the entry does not exist.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10196" name="Doctrine_Cache_Array.doDelete.new" size="130" author="theredled" created="Tue, 1 Dec 2009 13:29:58 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-126] Doctrine_Migration_Diff breaks on inherited class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-126</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This ticket is a duplicate of this one &lt;a href=&quot;http://trac.symfony-project.org/ticket/7272&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7272&lt;/a&gt; but it&apos;s more a Doctrine bug than a symfony one.&lt;/p&gt;

&lt;p&gt;When trying to make a diff on schema with inheritance, the task breaks when trying to load a model inherited from an other one.  I think this is because the inherited model might be loaded &lt;b&gt;before&lt;/b&gt; his ancestor. &lt;/p&gt;</description>
                <environment>php 5.3 / symfony 1.3</environment>
            <key id="10215">DC-126</key>
            <summary>Doctrine_Migration_Diff breaks on inherited class</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="futurecat">Marc Weistroff</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Oct 2009 18:18:09 +0000</created>
                <updated>Mon, 29 Mar 2010 13:29:07 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 21:32:04 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10267" author="jwage" created="Tue, 20 Oct 2009 18:39:04 +0000"  >&lt;p&gt;test case? any code to duplicate?&lt;/p&gt;</comment>
                    <comment id="10269" author="futurecat" created="Tue, 20 Oct 2009 18:47:24 +0000"  >&lt;p&gt;First a patch which is more a proof of concept...&lt;br/&gt;
It&apos;s getting late here and will code the test case tomorrow &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10275" author="futurecat" created="Wed, 21 Oct 2009 08:23:30 +0000"  >&lt;p&gt;I&apos;m having difficulties to prove it with the Doctrine Sandbox... Because it works fine in this case... :&apos;(&lt;br/&gt;
I past the error log, it might be helpful:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;stlto28:www marc$ php symfony doctrine:generate-migrations-diff
&amp;gt;&amp;gt; doctrine  generating migration diff
&amp;gt;&amp;gt; file+     /private/var/folders/vu/vuQEAsRN...-Tmp-/doctrine_schema_IRajfY.yml
PHP Fatal error:  Class &apos;ToPrfxuvmcCmsContent&apos; not found in /private/var/folders/vu/vuQEAsRNGECmKgHPU7Y1vk+++TI/-Tmp-/toprfx_doctrine_tmp_dirs/ToPrfxuvmcCmsArticle.php on line 15
PHP Stack trace:
PHP   1. {main}() /myProject/symfony:0
PHP   2. include() /myProject/symfony:14
PHP   3. sfSymfonyCommandApplication-&amp;gt;run() /myProject/lib/vendor/symfony/lib/command/cli.php:20
PHP   4. sfTask-&amp;gt;runFromCLI() /myProject/lib/vendor/symfony/lib/command/sfSymfonyCommandApplication.class.php:76
PHP   5. sfBaseTask-&amp;gt;doRun() /myProject/lib/vendor/symfony/lib/task/sfTask.class.php:97
PHP   6. sfDoctrineGenerateMigrationsDiffTask-&amp;gt;execute() /myProject/lib/vendor/symfony/lib/task/sfBaseTask.class.php:67
PHP   7. sfDoctrineBaseTask-&amp;gt;callDoctrineCli() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineGenerateMigrationsDiffTask.class.php:65
PHP   8. Doctrine_Cli-&amp;gt;run() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBaseTask.class.php:64
PHP   9. Doctrine_Cli-&amp;gt;_run() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cli.php:148
PHP  10. Doctrine_Task_GenerateMigrationsDiff-&amp;gt;execute() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cli.php:210
PHP  11. Doctrine_Migration_Diff-&amp;gt;generateMigrationClasses() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Task/GenerateMigrationsDiff.php:48
PHP  12. Doctrine_Migration_Builder-&amp;gt;generateMigrationsFromDiff() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php:111
PHP  13. Doctrine_Migration_Diff-&amp;gt;generateChanges() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Builder.php:147
PHP  14. Doctrine_Migration_Diff-&amp;gt;_diff() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php:99
PHP  15. Doctrine_Core::loadModels() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php:125
PHP  16. require_once() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php:649
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="10276" author="futurecat" created="Wed, 21 Oct 2009 12:39:42 +0000"  >&lt;p&gt;I tryed to reproduce the failing case in a doctrine sandbox but the task is executed just fine... So I tried with a Symfony sandbox and it failed. &lt;br/&gt;
I guess there is some kind of autoloading incompatibility somewhere. &lt;/p&gt;

&lt;p&gt;I uploaded a sandbox on symfony&apos;s trac with the failing schema. The ticket is viewable here &lt;a href=&quot;http://trac.symfony-project.org/ticket/7272&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7272&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanx&lt;/p&gt;</comment>
                    <comment id="10754" author="jwage" created="Wed, 18 Nov 2009 22:03:22 +0000"  >&lt;p&gt;This issue cannot be reproduced and no new information has been given.&lt;/p&gt;</comment>
                    <comment id="10979" author="agilbert" created="Wed, 2 Dec 2009 20:01:46 +0000"  >&lt;p&gt;I am having this problem as well.&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-java&quot;&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;gt;&amp;gt; doctrine  generating migration diff&lt;br/&gt;
&amp;gt;&amp;gt; file+     /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/&lt;del&gt;Tmp&lt;/del&gt;/doctrine_schema_87129.yml&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;ToPrfxpkContextCMSSlot&apos; not found in /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/&lt;del&gt;Tmp&lt;/del&gt;/toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 14&lt;/p&gt;
{/code}

&lt;p&gt;The most recent activity on this issue seems to be in the symfony Trac, where Jon said work would be continued in here, but this ticket is also closed. I don&apos;t know Jira as well, is there a way to re-open this ticket? Is there an active clone of it somewhere?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="11050" author="boutell" created="Mon, 7 Dec 2009 18:40:40 +0000"  >&lt;p&gt;Reproducible test case:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Remove your toprfx_doctrine_tmp_dirs etc. from your tmp folder, leftover classes from earlier crashes can cause unrelated errors, see separate ticket&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;svn co &lt;a href=&quot;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&quot; class=&quot;external-link&quot;&gt;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&lt;/a&gt; cmstest13&lt;br/&gt;
cd cmstest13&lt;br/&gt;
Create config/doctrine/schema.yml and add a trivial table so another bug won&apos;t be triggered (I opened a separate ticket on that):&lt;/p&gt;

&lt;p&gt;Frog:&lt;br/&gt;
  columns:&lt;br/&gt;
    name: string&lt;/p&gt;

&lt;p&gt;./symfony doctrine:build --all&lt;br/&gt;
./symfony doctrine:generate-migrations-diff&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;ToPrfxpkContextCMSSlot&apos; not found in /private/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/&lt;del&gt;Tmp&lt;/del&gt;/toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 15&lt;/p&gt;

&lt;p&gt;Note that pkContextCMSButtonSlot inherits from pkContextCMSSlot using Doctrine column aggregation inheritance. It appears that the autoloader just isn&apos;t trying to resolve inheritance relationships between classes in the toprfx_doctrine_tmp_dirs folder.&lt;/p&gt;</comment>
                    <comment id="11721" author="pulse00" created="Sun, 14 Feb 2010 15:23:20 +0000"  >&lt;p&gt;i&apos;ve created a patch which fixes the issue, it&apos;s attached to the corresponding symfony ticket:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.symfony-project.org/ticket/7272&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7272&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It modifies the core autoloading code and i&apos;m not really familiar with the doctrine autoloading code, so please let me know if this&lt;br/&gt;
approach can be approved.&lt;/p&gt;</comment>
                    <comment id="12490" author="jwage" created="Mon, 29 Mar 2010 13:20:57 +0000"  >&lt;p&gt;Hi, the patch cannot be committed. It is a blatant hack and cannot be applied. I have a solution I will commit soon though.&lt;/p&gt;</comment>
                    <comment id="12491" author="jwage" created="Mon, 29 Mar 2010 13:29:07 +0000"  >&lt;p&gt;This should be fixed now: &lt;a href=&quot;http://trac.symfony-project.org/changeset/28871&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/changeset/28871&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>