<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Mon May 20 05:40:37 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+resolution+%3D+Unresolved+AND+component+%3D+Behaviors+ORDER+BY+priority+DESC&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+resolution+%3D+Unresolved+AND+component+%3D+Behaviors+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="26" total="26"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-839] Version classes not built for models using package attribute</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-839</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For models using the &apos;package&apos; attribute in the schema definition, the version classes do not get created. However, the version table gets created.&lt;/p&gt;

&lt;p&gt;There is no problem during the build, but when loading fixtures, there is a fatal error: Class TaxCodeVersion not found&lt;/p&gt;

&lt;p&gt;TaxCode:&lt;br/&gt;
  package: Masters&lt;br/&gt;
  tableName: Fin_Tax_Codes&lt;br/&gt;
  actAs:&lt;br/&gt;
    Activateable: ~&lt;br/&gt;
    SoftDelete: ~&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Versionable:&lt;/li&gt;
	&lt;li&gt;tableName: fin_tax_codes_version
	&lt;ol&gt;
		&lt;li&gt;versionColumn: version&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
	&lt;li&gt;className: %CLASS%Version
	&lt;ol&gt;
		&lt;li&gt;auditLog: true&lt;br/&gt;
    Auditable: ~&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
.......&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment>PHP 5.2.3 / Symfony 1.4.6</environment>
            <key id="11819">DC-839</key>
            <summary>Version classes not built for models using package attribute</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="prasadgupte">Prasad Gupte</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Aug 2010 08:51:41 +0000</created>
                <updated>Tue, 8 Mar 2011 11:06:47 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15475" author="hetsch" created="Tue, 8 Mar 2011 11:06:47 +0000"  >&lt;p&gt;Same here,&lt;/p&gt;

&lt;p&gt;If i use this yaml file:&lt;/p&gt;


&lt;p&gt;Page:&lt;br/&gt;
  actAs: &lt;br/&gt;
    NestedSet:&lt;br/&gt;
      hasManyRoots: true&lt;br/&gt;
      rootColumnName: root_id&lt;br/&gt;
    Versionable:&lt;br/&gt;
      versionColumn: version&lt;br/&gt;
      className: %CLASS%Version&lt;br/&gt;
      auditLog: true&lt;br/&gt;
    Timestampable:&lt;br/&gt;
      created:&lt;br/&gt;
        name: created_at&lt;br/&gt;
        type: timestamp&lt;br/&gt;
        format: Y-m-d H&lt;br/&gt;
      updated:&lt;br/&gt;
        name: updated_at&lt;br/&gt;
        type: timestamp&lt;br/&gt;
        format: Y-m-d H&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;  &lt;br/&gt;
  columns:&lt;br/&gt;
    name: string(255)&lt;/p&gt;

&lt;p&gt;PageVersion and PageTranslation Models don&apos;t get generated if i use &apos;build-models-yaml&apos;. Have to create the Models manually then it works fine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-922] master-slave replication with i18n behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-922</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to use sfDoctrineMasterSlavePlugin for database replication with Symfony  1.4 and PHP 5.3. But facing problem while selecting I18n records and receiving &quot;Unknown relation alias Translation&quot; error.&lt;/p&gt;

&lt;p&gt;I&apos;ve also tried same with implementation solution given in master-slave chapter of doctrine cookbook but no success. &lt;/p&gt;

&lt;p&gt;Is anyone facing same problem with sfDoctrineMasterSlavePlugin and i18n behavio? Is there any solution of the problem?&lt;/p&gt;</description>
                <environment>php 5.3, doctrine 1.2, Symfony 1.4, mysql</environment>
            <key id="12088">DC-922</key>
            <summary>master-slave replication with i18n behavior</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="husen">husen mankada</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 02:34:37 +0000</created>
                <updated>Wed, 10 Nov 2010 02:34:37 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-371] Lazy loading - doctrine makes extra queries into db</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-371</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Just downloaded symfony 1.4&lt;/p&gt;

&lt;p&gt;First of all I have a query:&lt;/p&gt;

&lt;p&gt;                $q = \Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&apos;u.&lt;b&gt;, ur.&lt;/b&gt;&apos;)&lt;br/&gt;
                    -&amp;gt;from(&apos;UserDb u&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.RealUserDetailsDb ur&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.MockUserDetailsDb um&apos;)&lt;br/&gt;
                    -&amp;gt;where(&apos;u.id = :user_id&apos;)&lt;br/&gt;
                ;&lt;br/&gt;
                $user = $q-&amp;gt;fetchOne(array(&apos;:user_id&apos; =&amp;gt; $uid));&lt;/p&gt;

&lt;p&gt;After that I&apos;m accessing the fields of this object:&lt;/p&gt;

&lt;p&gt;                $userArray = array(&lt;br/&gt;
                    &apos;id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getId(),&lt;br/&gt;
                    &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId(),&lt;br/&gt;
                    &apos;mock_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getMockUserDetailsId(),&lt;br/&gt;
                    &apos;real_user_details&apos; =&amp;gt; array(),&lt;br/&gt;
                    &apos;mock_user_details&apos; =&amp;gt; array()&lt;br/&gt;
                );&lt;/p&gt;

&lt;p&gt;This is the actual queries into DB:&lt;/p&gt;

&lt;p&gt;NR1:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;&lt;em&gt;user_mock_id, u2.id AS u2&lt;/em&gt;&lt;em&gt;id, u2.nickname AS u2&lt;/em&gt;&lt;em&gt;nickname, u2.email AS u2&lt;/em&gt;_email FROM user u LEFT JOIN user_real u2 ON u.user_real_id = u2.id LEFT JOIN user_mock u3 ON u.user_mock_id = u3.id WHERE (u.id = :user_id)&lt;/p&gt;

&lt;p&gt;NR2:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;_user_mock_id FROM user u WHERE (u.id = &apos;1&apos;) LIMIT 1&lt;/p&gt;

&lt;p&gt;As you can see there are TWO queries however there should be only one query. The problem is that u.user_real_id is NULL in database and when I do  &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId() doctrine does not have enough intelligence to understand that these fields have been already requested in NR1. If I comment this field, everything works well. &lt;/p&gt;

&lt;p&gt;SURPRISE! &lt;br/&gt;
And now a surprise... if I modify a little bit my first query: &quot;&lt;del&gt;&amp;gt;select(&apos;u.&lt;b&gt;&apos;)&quot; instead of , &quot;&lt;/del&gt;&amp;gt;select(&apos;u.&lt;/b&gt;,  ur.*&apos;)&quot; it WON&apos;T make TWO queries. It will make ONLY ONE!&lt;/p&gt;

&lt;p&gt;As you understand this a very critical bug and of course our system won&apos;t go to production with this bug. &lt;/p&gt;

&lt;p&gt;P.S. Is it possible to turn off the lazy loading in doctrine?&lt;/p&gt;</description>
                <environment>Symfony 1.4, Doctrine Version: 1.2.0-BETA3</environment>
            <key id="10636">DC-371</key>
            <summary>Lazy loading - doctrine makes extra queries into db</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="drapeko">Roman Drapeko</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Dec 2009 22:53:48 +0000</created>
                <updated>Thu, 23 Dec 2010 20:22:10 +0000</updated>
                                    <version>1.2.0-BETA3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11405" author="drapeko" created="Sun, 17 Jan 2010 16:56:01 +0000"  >&lt;p&gt;Any comments? Will it be fixed??&lt;/p&gt;</comment>
                    <comment id="11893" author="jwage" created="Mon, 1 Mar 2010 15:52:49 +0000"  >&lt;p&gt;Hi, I&apos;d like to take a look but can you make a failing test case that I can run so that I can see if I can come up with a patch that fixes your case and doesn&apos;t break anything else.&lt;/p&gt;</comment>
                    <comment id="13087" author="lukis" created="Tue, 1 Jun 2010 13:11:16 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I had similar problem but after several hours i did work it out&lt;/p&gt;

&lt;p&gt;Try to make get method in your model for getting field which has NULL value in database&lt;/p&gt;

&lt;p&gt;public function getUserRealId() &lt;/p&gt;
{

  return $this-&amp;gt;_get(&quot;user_real_id&quot;, false);

}

&lt;p&gt;by making second argument false u force doctrine not to lazy load value and extra sql query is not created&lt;/p&gt;

&lt;p&gt;regards&lt;/p&gt;</comment>
                    <comment id="13207" author="jwage" created="Tue, 8 Jun 2010 16:31:53 +0000"  >&lt;p&gt;Has anyone been able to reproduce this in a test case? I am not having much luck so far.&lt;/p&gt;</comment>
                    <comment id="15001" author="gena01" created="Thu, 23 Dec 2010 20:22:10 +0000"  >&lt;p&gt;I&apos;ve seen this a ton of times. Basically when it loads related records through the Hydrator using leftJoin() and gets NULLs back. BUT it doesn&apos;t save the fact that the related records are NULL. So when you actually do call to getRelated objects it sees that it doesn&apos;t have the value cached and runs the query again.&lt;/p&gt;

&lt;p&gt;Let me know if I should show you the problem in the Doctrine code base.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </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-659] Sluggable behavior does not check uniqueness on insert if a slug is manually set, causing SQL error/crash</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-659</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Sluggable behavior has the following code:
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * Set the slug value automatically when a record is inserted
     *
     * @param Doctrine_Event $event
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preInsert(Doctrine_Event $event)
    {
        $record = $event-&amp;gt;getInvoker();
        $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) {
            $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;However, this can lead to problems...&lt;/p&gt;

&lt;p&gt;If the user incorrectly assigns a duplicate slug to the record then there is no uniqueness checking in doctrine and you get an uncaught SQL error looking something like this:&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;SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &apos;my-slug-en_GB&apos; for key &apos;foo_i18n_sluggable_idx&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If this kind of &quot;don&apos;t do a preInsert check if I manunally set the slug&quot; behavior is a &lt;em&gt;FEATURE&lt;/em&gt; then it would be best to have an option to allow it to be disabled. If it is a &lt;em&gt;BUG&lt;/em&gt; then I would suggest that the preInsert method should be changed to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * Set the slug value automatically when a record is inserted
     *
     * @param Doctrine_Event $event
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preInsert(Doctrine_Event $event)
    {
        $record = $event-&amp;gt;getInvoker();
        $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) {
            $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; { &lt;span class=&quot;code-comment&quot;&gt;// Still check &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; slug uniqueness when you insert
&lt;/span&gt;            $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;C&lt;/p&gt;</description>
                <environment>symfony-1.3.4 and doctrine-1.2.2</environment>
            <key id="11307">DC-659</key>
            <summary>Sluggable behavior does not check uniqueness on insert if a slug is manually set, causing SQL error/crash</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="caponica">Christian Seaman</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 May 2010 14:22:21 +0000</created>
                <updated>Tue, 5 Oct 2010 11:14:25 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13177" author="jwage" created="Tue, 8 Jun 2010 13:38:42 +0000"  >&lt;p&gt;Can you provide your changes as a patch/diff with a test case?&lt;/p&gt;</comment>
                    <comment id="14531" author="caponica" created="Tue, 5 Oct 2010 11:14:25 +0000"  >&lt;p&gt;Hi Jonathan,&lt;/p&gt;

&lt;p&gt;I&apos;m not so hot at making patches or test cases, but it should be fairly easy if you know what you&apos;re doing...&lt;/p&gt;

&lt;p&gt;Just try to create and save two records with the same hard-coded slug and the second one will fail with an ugly MySQL crash.&lt;/p&gt;

&lt;p&gt;If you add the lines&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;        } else { // Still check for slug uniqueness when you insert
            $record-&amp;gt;$name = $this-&amp;gt;buildSlugFromSlugField($record);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to the Sluggable::preInsert() method then this problem is averted and the test cases will pass.&lt;/p&gt;

&lt;p&gt;I have been running with this modification in our production version of Doctrine since I first reported this in May and it all seems to work well.&lt;/p&gt;

&lt;p&gt;If you really need me to figure out how to make a patch and test case please re-comment on this ticket and I&apos;ll see what I can do when I have some free time.&lt;/p&gt;


&lt;p&gt;C&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-899] Expose hardDelete method on node object when SoftDelete behavior is used</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-899</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When combining SoftDelete and NestedSet behavior, there&apos;s no way of calling hardDelete method on node object. According to documentation, to peform a delete on a nested set, delete should be called in node object, which will call delete method on the object itself.&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="12027">DC-899</key>
            <summary>Expose hardDelete method on node object when SoftDelete behavior is used</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="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="fvaresi">Fernando Varesi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 10:55:52 +0000</created>
                <updated>Fri, 22 Oct 2010 10:55:52 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-880] Versionable + I18n creates additional migration with irrelevant data</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-880</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;First run of generate-migrations-diff and migrate creates 2 migration diff files. First one for new tables, second one for new indexes and foreign keys. Than if I run generate-migrations-diff again another version is created although nothing was changed and following is inside:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;1st entry tries to drop a foreign key never been created and not existing in file&lt;/li&gt;
	&lt;li&gt;next entry tries to create a foreign key already existing&lt;/li&gt;
	&lt;li&gt;3rd entry tries to create an existing index&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;After a long try and errorI found out that it&apos;s only happening with I18n plus Versionable behavior.&lt;/p&gt;

&lt;p&gt;As I already have spent much time for a report please have also a look at: &lt;a href=&quot;http://forum.diem-project.org/viewtopic.php?f=2&amp;amp;t=173&amp;amp;sid=5e0e3349c0e15a169bc9990a3104b3f6#p465&quot; class=&quot;external-link&quot;&gt;http://forum.diem-project.org/viewtopic.php?f=2&amp;amp;t=173&amp;amp;sid=5e0e3349c0e15a169bc9990a3104b3f6#p465&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I&apos;m quite new to Doctrine and Symfony systems I cannot get further, but willing for more investigation if just one could give me a hint where to start.&lt;/p&gt;</description>
                <environment>PHP 5.2, Symfony 1.4, Diem 5.1, Doctrine 1.2.2</environment>
            <key id="11982">DC-880</key>
            <summary>Versionable + I18n creates additional migration with irrelevant data</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="sanshao">Thomas</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Oct 2010 14:37:39 +0000</created>
                <updated>Mon, 19 Sep 2011 08:20:21 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Behaviors</component>
                <component>I18n</component>
                <component>Migrations</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14551" author="andrewcoulton" created="Sun, 10 Oct 2010 20:50:17 +0000"  >&lt;p&gt;I think this is because the versionable behaviour doesn&apos;t define a table name in the Doctrine_Template_Versionable class. As a result, if using model prefixes, the prefixes are not discarded from the table names when the behaviour model classes are built. This means that the tables have different names to what is expected, so they have different index keys, so the indexes are dropped and recreated as part of the migration.&lt;/p&gt;

&lt;p&gt;I have committed unit tests and patch for this issue (which applies to Searchable also) to &lt;a href=&quot;http://github.com/acoulton/doctrine1/tree/DC-880&quot; class=&quot;external-link&quot;&gt;http://github.com/acoulton/doctrine1/tree/DC-880&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16492" author="xdade" created="Mon, 19 Sep 2011 08:19:31 +0000"  >&lt;p&gt;I experienced the same problem in the latest version 1.2.4, and the patch proposed by Andrew Coulton solves the problem.&lt;br/&gt;
Why the fix is not included in official release?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-878] cannot access the version models using object-&gt;CLASSNAMEVersion in v1.2.3</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-878</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Doctrine 1.1 if I said&lt;/p&gt;

&lt;p&gt;$vAaaaa = Doctrine::getTable(&apos;Aaaaa&apos;)-&amp;gt;find(1);&lt;br/&gt;
print_r( $vAaaaa-&amp;gt;AaaaaVersion ); // print_r( $vAaaaa-&amp;gt;AaaaaVersion&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;toArray() );&lt;/p&gt;

&lt;p&gt;then I got the corresponding version model/array. Our application is using this nice behaviour at several places. But then the project got upgraded to Doctrine 1.2.3, and since then it dies saying&lt;/p&gt;

&lt;p&gt;Unknown record property / related component &quot;UserVersion&quot; on &quot;User&quot; on line 55 of file /home/roland/www/cabcall/library/Doctrine/Doctrine/Record/Filter/Standard.php&lt;br/&gt;
#0 /home/roland/www/cabcall/library/Doctrine/Doctrine/Record.php(1395): Doctrine_Record_Filter_Standard-&amp;gt;filterGet(Object(User), &apos;UserVersion&apos;)&lt;br/&gt;
#1 /home/roland/www/cabcall/library/Doctrine/Doctrine/Record.php(1350): Doctrine_Record-&amp;gt;_get(&apos;UserVersion&apos;, true)&lt;br/&gt;
#2 /home/roland/www/cabcall/library/Doctrine/Doctrine/Access.php(72): Doctrine_Record-&amp;gt;get(&apos;UserVersion&apos;)&lt;br/&gt;
#3 /home/roland/www/cabcall/application/controllers/TestController.php(12): Doctrine_Access-&amp;gt;__get(&apos;UserVersion&apos;)&lt;br/&gt;
#4 /home/roland/www/cabcall/library/Zend/Controller/Action.php(513): TestController-&amp;gt;indexAction()&lt;br/&gt;
#5 /home/roland/www/cabcall/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action-&amp;gt;dispatch(&apos;indexAction&apos;)&lt;br/&gt;
#6 /home/roland/www/cabcall/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))&lt;br/&gt;
#7 /home/roland/www/cabcall/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&amp;gt;dispatch()&lt;br/&gt;
#8 /home/roland/www/cabcall/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()&lt;br/&gt;
#9 /home/roland/www/cabcall/public/index.php(64): Zend_Application-&amp;gt;run()&lt;br/&gt;
#10 &lt;/p&gt;
{main}

&lt;p&gt;Here is the exact example I tried before posting:&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;
Aaaaa:
    tableName: aaaaa
    columns:
        something:
            type: integer(8)
            unsigned: false
            notnull: true
            default: 0
    actAs:
        Versionable:
            versionColumn: version
            className: %CLASS%Version
            auditLog: true
            deleteVersions: true


class AaaaaTable extends Doctrine_Table
{
    /**
     * Returns an instance of this class.
     *
     * @return object AaaaaTable
     */
    public static function getInstance()
    {
        return Doctrine_Core::getTable(&apos;Aaaaa&apos;);
    }
}


abstract class BaseAaaaa extends Doctrine_Record
{

    public function setTableDefinition()
    {
        $this-&amp;gt;setTableName(&apos;aaaaa&apos;);
        $this-&amp;gt;hasColumn(&apos;something&apos;, &apos;integer&apos;, 8, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; true,
             &apos;default&apos; =&amp;gt; 0,
             &apos;length&apos; =&amp;gt; &apos;8&apos;,
             ));

        $this-&amp;gt;option(&apos;type&apos;, &apos;INNODB&apos;);
        $this-&amp;gt;option(&apos;collate&apos;, &apos;utf8_general_ci&apos;);
        $this-&amp;gt;option(&apos;charset&apos;, &apos;utf8&apos;);
    }

    public function setUp()
    {
        parent::setUp();
        $versionable0 = new Doctrine_Template_Versionable(array(
             &apos;versionColumn&apos; =&amp;gt; &apos;version&apos;,
             &apos;className&apos; =&amp;gt; &apos;%CLASS%Version&apos;,
             &apos;auditLog&apos; =&amp;gt; true,
             &apos;deleteVersions&apos; =&amp;gt; true
             ));

        $this-&amp;gt;actAs($versionable0);
    }

}


class Aaaaa extends BaseAaaaa
{

}


/*
$vAaaaa = New Aaaaa;
$vAaaaa-&amp;gt;something = 1;
$vAaaaa-&amp;gt;save();
*/

$vAaaaa = Doctrine::getTable(&apos;Aaaaa&apos;)-&amp;gt;find(1);

print_r( $vAaaaa-&amp;gt;AaaaaVersion );

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP Version 5.2.10-2ubuntu6.5 ; Suhosin Patch 0.9.7 ; Ubuntu 9.10 2.6.31-22-generic x86_64 ; Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.5 with Suhosin-Patch  ; Doctrine 1.2.3</environment>
            <key id="11969">DC-878</key>
            <summary>cannot access the version models using object-&gt;CLASSNAMEVersion in v1.2.3</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="hroland">Roland Huszti</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 11:21:45 +0000</created>
                <updated>Thu, 7 Oct 2010 06:14:53 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14508" author="hroland" created="Fri, 1 Oct 2010 05:18:41 +0000"  >&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;
&amp;lt;?php

class OSS_Resource_Doctrine extends Zend_Application_Resource_ResourceAbstract
{
    /**
     * Holds the Doctrine instance
     *
     * @var
     */
    protected $_doctrine;


    public function init()
    {
        // Return Doctrine so bootstrap will store it in the registry
        return $this-&amp;gt;getDoctrine();
    }


    public function getDoctrine()
    {
        if ( null === $this-&amp;gt;_doctrine )
        {
            // Get Doctrine configuration options from the application.ini file
            $doctrineConfig = $this-&amp;gt;getOptions();

            require_once &apos;Doctrine.php&apos;;

            $loader = Zend_Loader_Autoloader::getInstance();
            $loader-&amp;gt;pushAutoloader( array( &apos;Doctrine&apos;, &apos;autoload&apos; ) );
            $loader-&amp;gt;pushAutoloader( array( &apos;Doctrine&apos;, &apos;modelsAutoload&apos; ) );

            $manager = Doctrine_Manager::getInstance();

            $manager-&amp;gt;setAttribute( Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE );
            $manager-&amp;gt;setAttribute( Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true );
            $manager-&amp;gt;setAttribute( Doctrine::ATTR_USE_DQL_CALLBACKS, true );

            $manager-&amp;gt;setCollate( &apos;utf8_unicode_ci&apos; );
            $manager-&amp;gt;setCharset( &apos;utf8&apos; );

            Doctrine::loadModels( $doctrineConfig[&apos;models_path&apos;] );

            $db_profiler = new Doctrine_Connection_Profiler();

            $manager-&amp;gt;openConnection( $doctrineConfig[&apos;connection_string&apos;] );
            $manager-&amp;gt;connection()-&amp;gt;setListener( $db_profiler );

            $manager-&amp;gt;connection()-&amp;gt;setCollate(&apos;utf8_unicode_ci&apos;);
            $manager-&amp;gt;connection()-&amp;gt;setCharset(&apos;utf8&apos;);

            Zend_Registry::set( &apos;db_profiler&apos;, $db_profiler );

            $this-&amp;gt;_doctrine = $manager;
        }

        return $this-&amp;gt;_doctrine;
    }

    /**
     * Set the classes $_doctrine member
     *
     * @param $doctrine The object to set
     */
    public function setDoctrine( $doctrine )
    {
        $this-&amp;gt;_doctrine = $doctrine;
    }

}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14543" author="hroland" created="Thu, 7 Oct 2010 06:14:53 +0000"  >&lt;p&gt;To have this very nice and useful feature, I had to add these lines by hand to my audited table&apos;s models. Not to the base models, those are overwritten every time you migrate to a new version! Also, in the YAML file you can set the classname to whatever you want, so you need to use the same name in the model, too!&lt;/p&gt;

&lt;p&gt;MODEL&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;
class XYZ extends BaseXYZ

{


    public function setUp()

    {

        parent::setUp();

        $this-&amp;gt;hasMany(&apos;XYZVersion&apos;, array( &apos;local&apos; =&amp;gt; &apos;id&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        // you may get the classname from the model, so then you only need to copy-paste the exact same piece of setUp() code into every model you want to
    }


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


&lt;p&gt;YAML&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;    actAs:
        Versionable:
            versionColumn: version
            className: %CLASS%Version    # this is the default, User -&amp;gt; UserVersion , Address -&amp;gt; AddressVersion, etc.
            auditLog: true
            deleteVersions: true
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-858] Custom Behaviors/Templates cause autoloader errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-858</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When emitting Behaviors from schema files (YAML in our case),&lt;br/&gt;
Doctrine expects a shortened class name of the behavior (e.g. &apos;Timestampable&apos;) instead of the full class name:&lt;br/&gt;
The string &apos;Doctrine_Template_&apos; is automatically prepended and a check (class_exists()) is made.&lt;/p&gt;

&lt;p&gt;This is leading to possible autoloader errors (in our case: Zend autoloader does not find our custom behavior):&lt;/p&gt;


&lt;p&gt;YAML:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
Person:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;SoftDelete, My_Doctrine_Template_CustomBehavior&amp;#93;&lt;/span&gt;&lt;br/&gt;
  ...&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;&apos;SoftDelete&apos; is the short class name of &apos;Doctrine_Template_SoftDelete&apos;.&lt;br/&gt;
&apos;My_Doctrine_Template_CustomBehavior&apos; is the full class name and shall not be prefixed with &apos;Doctrine_Template_&apos;.&lt;/p&gt;


&lt;p&gt;The corresponding section responsible for this bug:&lt;/p&gt;

&lt;p&gt;File: Doctrine/Import/Builder.php&lt;br/&gt;
Lines: 702-704, function emitAssign()&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
if (class_exists(&quot;Doctrine_Template_$name&quot;, true)) &lt;/p&gt;
{
    $classname = &quot;Doctrine_Template_$name&quot;;
}
}}&lt;br/&gt;
&lt;br/&gt;
There is no test whether a full class name is given as $name, so there is no way to add custom behaviors to records without the autoloader checking for a non-existing class and spilling errors/notices.&lt;br/&gt;
With the above YAML schema file it would test for class_exists(&apos;Doctrine_Template_My_Doctrine_Template_CustomBehavior&apos;), which is obviously not existing.&lt;br/&gt;
&lt;br/&gt;
a quick fix could look like this:&lt;br/&gt;
&lt;br/&gt;
{{&lt;br/&gt;
if (strpos($name, &apos;_&apos;) === false // is this a shortened name of an original Doctrine behaviour class?&lt;br/&gt;
            &amp;amp;&amp;amp; class_exists(&quot;Doctrine_Template_$name&quot;, true)) {    $classname = &quot;Doctrine_Template_$name&quot;;}}}

&lt;p&gt;Another alternative (but breaking compatability with existing schema files) would be to &lt;em&gt;always&lt;/em&gt; use full class names instead of fancy short names.&lt;/p&gt;


&lt;p&gt;Interestingly enough, this error is only occuring with Zend autoloader on Windows systems, but can be easily avoided with the fix like suggested above.&lt;/p&gt;</description>
                <environment>Windows Vista/7&lt;br/&gt;
PHP 5.3.1 - 5.3.3&lt;br/&gt;
Zend autoloader&lt;br/&gt;
not occuring under Ubuntu 10.05 / MacOSX</environment>
            <key id="11883">DC-858</key>
            <summary>Custom Behaviors/Templates cause autoloader errors</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="apric">apric</reporter>
                        <labels>
                    </labels>
                <created>Sat, 4 Sep 2010 11:38:30 +0000</created>
                <updated>Sat, 4 Sep 2010 19:09:33 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14277" author="jwage" created="Sat, 4 Sep 2010 19:09:33 +0000"  >&lt;p&gt;I believe this is because the Zend autoloader does not fail silently by default. I think it can be configured to check if the file exists and not throw any errors.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-958] updating Models with Intra-Table Relations cascades strangely</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-958</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sorry for the lengthy explanation, couldn&apos;t make it more straight forward:&lt;/p&gt;

&lt;p&gt;I have a model which is similiar to a nestet set but the tree structure needs to overlap:&lt;/p&gt;

&lt;p&gt;For Model A, every Object A1 can have multiple descendant objects A2 and in turn can be a descendant of multiple objects A0.&lt;/p&gt;

&lt;p&gt;Since I saw no way to do this with Nested-Set Relations (or Equal-Nested-Sets) I have set up my Model like this:&lt;/p&gt;

&lt;p&gt;modules:&lt;br/&gt;
  columns: ..&amp;lt;do not matter&amp;gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Children:&lt;br/&gt;
      class: modules&lt;br/&gt;
      refClass: modules_required&lt;br/&gt;
    Parents:&lt;br/&gt;
      class: modules&lt;br/&gt;
      refClass: modules_required&lt;/p&gt;

&lt;p&gt;modules_required:&lt;br/&gt;
  columns: &amp;lt;do not matter here, just 2 foreign key columns&amp;gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Children:&lt;br/&gt;
    Parents:&lt;/p&gt;

&lt;p&gt;I needed to specify the Relations on both tables, to use onDelete/onUpdate CASCADE rules. Generated Models look fine, just as intended.&lt;br/&gt;
(Every Class has many Children and has many Parents...)&lt;/p&gt;

&lt;p&gt;Now the strange part:&lt;br/&gt;
    When I update an object of modules (say id=18), Doctrine issues the following queries:&lt;br/&gt;
DELETE FROM modules_required WHERE (required_id = ? AND module_id IN (?, ?, ?, ?, ?)) - (18, 25, 26, 32, 34, 35) &lt;br/&gt;
// where 25 to 35 are CHILDREN of 18&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (25, 25, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (26, 26, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (32, 32, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (34, 34, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (35, 35, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (25, 25, 12)&lt;br/&gt;
//where 10 and 12 are PARENTS of 18&lt;br/&gt;
and somewhen, Doctrine encounters an MySQL ERROR because of the previous update marathon:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;25-25&apos; for key &apos;PRIMARY&apos; &lt;/p&gt;

&lt;p&gt;The point is: &lt;br/&gt;
1. why is Doctrine trying to create self-referencing relations, and &lt;br/&gt;
2. why is it touching the relation at all, when i only did change some text fields in the object?&lt;/p&gt;

&lt;p&gt;Is there a better way to solve my problem?&lt;/p&gt;</description>
                <environment>PHP 5.3 / symfony 1.4.9</environment>
            <key id="12323">DC-958</key>
            <summary>updating Models with Intra-Table Relations cascades strangely</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12278">DC-952</parent>
                        <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="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Jan 2011 11:42:09 +0000</created>
                <updated>Thu, 27 Jan 2011 04:21:44 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Nested Set</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15182" author="bigbadbassman" created="Tue, 25 Jan 2011 04:37:46 +0000"  >&lt;p&gt;forgot to add something: I have done a debug run, to see why these queries are created, when there was no data modified that related to these tables:&lt;/p&gt;

&lt;p&gt;Doctrine seems to handle my structure internally as a Nested-Set, although I have not specified an actAs: NestedSet or relations: equal: true statement in the model definition.&lt;br/&gt;
Is there a way to prevent symfony from misinterpreting this?&lt;/p&gt;

&lt;p&gt;This is not a nested set, as each object can have virtually any other object either as parent or as a child, and additionaly, parent relations can span multiple tree-levels:&lt;br/&gt;
Object 2 is parent of Object 3 and 6&lt;br/&gt;
Object 3 is parent of Object 4 and 5&lt;br/&gt;
Object 4 is parent of Object 6&lt;/p&gt;

&lt;p&gt;results in: Object 6 has parents 2 and 4 (where 4 has parent 3 and 3 has parent 2 in turn)&lt;/p&gt;

&lt;p&gt;This spanning relations seems to cause the guessed nested set to fail.&lt;/p&gt;

&lt;p&gt;I simply wanted to create an m:n Relation using a Reference table and the fact that both m and n are of the same class should not consider doctrine.&lt;/p&gt;</comment>
                    <comment id="15190" author="bigbadbassman" created="Wed, 26 Jan 2011 05:36:25 +0000"  >&lt;p&gt;related to #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-329&quot; title=&quot;Problem saving Self Referencing (Nest Relations)&quot;&gt;DC-329&lt;/a&gt;:&lt;br/&gt;
seems to be the same general problem as described there. Only in DC 1.2.3, doctrine tries to delete every child-relation for some unknown reason.&lt;/p&gt;

&lt;p&gt;also the h2aEqualable mentioned there does not work, because it does not prevent symfony from issueing the delete queries. It prevents only the UPDATE-Queries, and thus circumvents the MySQL-Error.&lt;/p&gt;

&lt;p&gt;Nevertheless, data is still corrupted after object save, thus not useable in production.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-955] Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-955</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sample schema:&lt;/p&gt;

&lt;p&gt;Blog:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;Versionable, Searchable&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
   id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;   name: string&lt;br/&gt;
   text: text&lt;/p&gt;

&lt;p&gt;When dumping data of a schema with Versionable and/or Searchable Behaviour, the dump.yml will contain all data, including the *_version and *_index tables.&lt;/p&gt;

&lt;p&gt;Trying to load the same .yml file results in Duplicate-Key constraint violations, as long as the data for the *_version and *_index tables is present.&lt;br/&gt;
The import is only successfull, when the data for these tables is discarded.&lt;br/&gt;
This leads to the issue, that one can only do a dump-load cycle, when the complete version history of a Model is discarded. Which makes dump-load for such models rather useless.&lt;/p&gt;</description>
                <environment>PHP 5.3.3 / symfony 1.4.9-dev / MySQL 5.0</environment>
            <key id="12301">DC-955</key>
            <summary>Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</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="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2011 04:38:57 +0000</created>
                <updated>Fri, 14 Jan 2011 04:42:12 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Data Fixtures</component>
                <component>Import/Export</component>
                <component>Searchable</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-992] I18n - Translated fields are not deleted when record in master table is deleted</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-992</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have used I18n behavior for my application using the following:&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 setTableDefinition()
{
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;products&apos;);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 4, 
            array(&apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 
                  &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 
                  &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;permalink&apos;, &apos;string&apos;, 255,
            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;title&apos;, &apos;string&apos;, 255, 
            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;teaser&apos;, &apos;string&apos;, 255, 
            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;content&apos;, &apos;clob&apos;, 32767);
}

&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;actAs(&apos;I18n&apos;, array(
                &apos;fields&apos; =&amp;gt; array(&apos;title&apos;, &apos;teaser&apos;, &apos;content&apos;)
            )
        );
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine has created two tables db named products and products_translation.&lt;/p&gt;

&lt;p&gt;Insert and update of the record is working fine but when i perform a deletion of a record, the record is deleted from the products table but the translations stored in products translation table are not deleted.&lt;/p&gt;</description>
                <environment>Windows XP, xampp 1.7.3 (PHP 5.3.1)</environment>
            <key id="12525">DC-992</key>
            <summary>I18n - Translated fields are not deleted when record in master table is deleted</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="tfotis">Thanasis Fotis</reporter>
                        <labels>
                    </labels>
                <created>Sun, 3 Apr 2011 07:28:13 +0000</created>
                <updated>Fri, 28 Oct 2011 05:42:02 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16707" author="gamesh" created="Fri, 28 Oct 2011 05:42:02 +0000"  >&lt;p&gt;if you are not using transaction type tables like innoDB you need to set &apos;appLevelDelete&apos; =&amp;gt; TRUE option for I18n&lt;br/&gt;
it&apos;s not documented feature as i found out.&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;actAs(&apos;I18n&apos;, array(&lt;br/&gt;
                &apos;fields&apos; =&amp;gt; array(&apos;title&apos;, &apos;teaser&apos;, &apos;content&apos;),&lt;br/&gt;
               &apos;appLevelDelete&apos; =&amp;gt; TRUE,&lt;br/&gt;
            )&lt;br/&gt;
        );&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-430] I18n and inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-430</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using i18n with inheritance, the localizables fields are overrinden by the second deriving class.&lt;br/&gt;
So, the translation table is containing only fields from one of the two descending classes.&lt;/p&gt;

&lt;p&gt;The yml is below:&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  columns:&lt;br/&gt;
    email:            string(255)&lt;br/&gt;
    ...&lt;/p&gt;

&lt;p&gt;Employer:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends:  User&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;description, company&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:      &lt;br/&gt;
    company:  string(255)     &lt;br/&gt;
    description:  text&lt;/p&gt;

&lt;p&gt;Recruiter:&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;position&amp;#93;&lt;/span&gt;&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends:  User&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
  columns:&lt;br/&gt;
    position: string(255)&lt;/p&gt;</description>
                <environment>Doctrine 1.2 with Symfony 1.4</environment>
            <key id="10734">DC-430</key>
            <summary>I18n and inheritance</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="jwconsulting">Julien Wadin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Jan 2010 12:55:49 +0000</created>
                <updated>Fri, 15 Jan 2010 12:55:49 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-362] Doctrine fails to create correct table structure if model is named &quot;User&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-362</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When building models and database structure from YAML schema, Doctrine ignores the behaviors and relations on models if it is named &quot;User&quot;:&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-none&quot;&gt;...

User:  
  actAs:
    Timestampable:
    Sluggable:
      unique: true
      fields: username
      canUpdate: true
  columns:
    id:
      type: integer(4)
      primary: true
      autoincrement: true
    company_id
      type: integer(4)
    timezone_id:
      type: integer(1)
    role_id:
      type: integer(1)
    email:
      type: string(255)
    username:
      type: string(255)
      unique: true
    password:
      type: string(40)
    firstname:
      type: string(255)
    lastname:
      type: string(255)
    last_login:
      type: datetime
  relations:
    Company:
      local: company_id
      foreign: id
    Timezone:
      local: timezone_id
      foreign: id
    Role:
      local: role_id
      foreign: id

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

&lt;p&gt;This creates the following table structure:&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-sql&quot;&gt;CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` int(11) DEFAULT NULL,
  `timezone_id` tinyint(4) DEFAULT NULL,
  `role_id` tinyint(4) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `password` varchar(40) DEFAULT NULL,
  `firstname` varchar(255) DEFAULT NULL,
  `lastname` varchar(255) DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The table structure is both missing foreign key constraints to Company, Timezone and Role. It is also missing columns &lt;tt&gt;updated_at&lt;/tt&gt; and &lt;tt&gt;created_at&lt;/tt&gt; for Timestampable behavior. The &lt;tt&gt;slug&lt;/tt&gt; column for Sluggable behavior is missing, as well.&lt;/p&gt;

&lt;p&gt;When looking at the BaseUser::setUp() method it looks as it is supposed to:&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-none&quot;&gt;class BaseUser extends Doctrine_Record
{

    ....

    public function setUp()
    {
        parent::setUp();
        $this-&amp;gt;hasOne(&apos;Company&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;company_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $this-&amp;gt;hasOne(&apos;Timezone&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;timezone_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $this-&amp;gt;hasOne(&apos;Role&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;role_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $sluggable0 = new Doctrine_Template_Sluggable(array(
             &apos;unique&apos; =&amp;gt; true,
             &apos;fields&apos; =&amp;gt; &apos;username&apos;,
             &apos;canUpdate&apos; =&amp;gt; true,
        ));
        $this-&amp;gt;actAs($timestampable0);
        $this-&amp;gt;actAs($sluggable0);
    }

    ....

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

&lt;p&gt;So the only area where it goes wrong, is when generating the queries for creating the model tables. I don&apos;t know if the same problem appears with other model names, but it doesn&apos;t like models named &quot;User&quot;.&lt;/p&gt;

&lt;p&gt;If I rename the model to &quot;Person&quot; and rebuild, it all works perfectly as it should.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6.2 (10C540) (Snow Leopard) with MAMP 1.8 bundle: &lt;br/&gt;
PHP Version: 5.2.10,&lt;br/&gt;
MySQL Version: 5.1.37&lt;br/&gt;
</environment>
            <key id="10623">DC-362</key>
            <summary>Doctrine fails to create correct table structure if model is named &quot;User&quot;</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="michenriksen">Michael Henriksen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Dec 2009 13:59:26 +0000</created>
                <updated>Fri, 8 Jan 2010 20:31:09 +0000</updated>
                                    <version>1.2.0-RC1</version>
                                                <component>Behaviors</component>
                <component>Query</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11201" author="michenriksen" created="Wed, 16 Dec 2009 14:04:39 +0000"  >&lt;p&gt;Forgot to mention, that it works perfectly when renaming model to something else than &quot;User&quot;&lt;/p&gt;</comment>
                    <comment id="11357" author="neographikal" created="Fri, 8 Jan 2010 20:31:09 +0000"  >&lt;p&gt;Have the same problem in 1.2.1 at PostgreSQL 8.4&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-325] doctrine  pager  class  with   sql server  stored procedure</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-325</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;i am using doctrine pager  class  for pagination in symfony   but not able to find any help  how i can i use   it&lt;/p&gt;

&lt;p&gt;i am using sql server  stored  procedures for  fetching databasae .&lt;/p&gt;

&lt;p&gt;Thnaks&lt;/p&gt;

&lt;p&gt;Khurram &lt;/p&gt;</description>
                <environment>php 5.3.0  sql server 2000  symfony 1.2.9</environment>
            <key id="10562">DC-325</key>
            <summary>doctrine  pager  class  with   sql server  stored procedure</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="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="alityagi2008@gmail.com">khurram Ali</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Dec 2009 04:46:11 +0000</created>
                <updated>Fri, 4 Dec 2009 04:46:11 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-648] Behavior geographical generates latitude DOUBLE(18, 2), longitude DOUBLE(18, 2) - it&apos;s not exact</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-648</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem was already described by another person at &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-385&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-385&lt;/a&gt;&lt;br/&gt;
and was fixed but now is broken again.&lt;/p&gt;

&lt;p&gt;When using the Geographical behaviour in a YML schema the latitude is stored in Mysql as a Double(18,2) instead of a Double as it was in the previous versions. It appears that all doubles in yml are defaulting to (18,2).&lt;/p&gt;</description>
                <environment>Doctrine 1.2.2</environment>
            <key id="11265">DC-648</key>
            <summary>Behavior geographical generates latitude DOUBLE(18, 2), longitude DOUBLE(18, 2) - it&apos;s not exact</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="indiekiduk">Malcolm Hall</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Apr 2010 13:20:03 +0000</created>
                <updated>Wed, 19 Jan 2011 05:26:19 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12744" author="indiekiduk" created="Sat, 24 Apr 2010 13:39:55 +0000"  >&lt;p&gt;The problem lies in DataDict/Mysql.php&lt;/p&gt;

&lt;p&gt;Previously it was:&lt;/p&gt;

&lt;p&gt;case &apos;double&apos;:&lt;br/&gt;
return &apos;DOUBLE&apos;;&lt;/p&gt;

&lt;p&gt;now it&apos;s:&lt;/p&gt;

&lt;p&gt;case &apos;double&apos;:&lt;br/&gt;
                $length = !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;) ? $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt; : 18;&lt;br/&gt;
                $scale = !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt;) ? $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt; : $this-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);&lt;br/&gt;
                return &apos;DOUBLE(&apos;.$length.&apos;, &apos;.$scale.&apos;)&apos;;&lt;/p&gt;

&lt;p&gt;Perhaps this could be improved so that if there is no length specified it returns just double with no length or scale instead of defaulting to 18, ATTR_DECIMAL_PLACES? I expect that most people that use the double type in yaml wouldn&apos;t want only 2 decimals.&lt;/p&gt;</comment>
                    <comment id="13181" author="jwage" created="Tue, 8 Jun 2010 13:53:29 +0000"  >&lt;p&gt;Can you provide a patch that fixes the situation for you? we&apos;ll see if that has any breakage of current tests.&lt;/p&gt;</comment>
                    <comment id="13706" author="spike008t" created="Mon, 26 Jul 2010 13:56:18 +0000"  >&lt;p&gt;I have the same trouble, and I fix it by specified directly the precision of the double into Doctrine_Template_Geographical class.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&apos;type&apos;     =&amp;gt;  &apos;double(18,8)&apos;,&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    <comment id="14681" author="janusz.slota" created="Mon, 8 Nov 2010 08:54:54 +0000"  >&lt;p&gt;You can fix it with:&lt;br/&gt;
Geographical:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;latitude:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type: float(18,8)&lt;br/&gt;
&amp;nbsp;&amp;nbsp;longitude:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type: float(18,8)&lt;/p&gt;

&lt;p&gt;instead of:&lt;br/&gt;
Geographical: ~&lt;/p&gt;</comment>
                    <comment id="15149" author="spike008t" created="Wed, 19 Jan 2011 05:26:19 +0000"  >&lt;p&gt;diff on Template/Geographical.php&lt;/p&gt;

&lt;p&gt;Hope that could help&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10913" name="patch.diff" size="1091" author="spike008t" created="Wed, 19 Jan 2011 05:26:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-630] Add Undelete functionality to SoftDelete behaviour</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-630</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Can an undelete function be added to the Doctrine ORM which will reset deleted_at fields to null and conform to cascade rules (just as the original delete did)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11220">DC-630</key>
            <summary>Add Undelete functionality to SoftDelete behaviour</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</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="harryhobbes">Harry Birrell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 01:35:57 +0000</created>
                <updated>Thu, 15 Apr 2010 01:35:57 +0000</updated>
                                                                    <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <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-485] Limit gets lost when doing self join</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-485</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;hi doctrine team,&lt;br/&gt;
today I encountered a very weird problem when I tried to do a selfjoin on a table. the goal was to list all people that have the same addresses but limit the result to 5&lt;/p&gt;

&lt;p&gt;the problem was, that the doctrine split it into 2 querys and first selected the correct address ids with the Limit 5. but in the second query the limit is lost. which gives me more than 5 results if a few people have the same address&lt;/p&gt;

&lt;p&gt;the DQL looks like this&lt;/p&gt;

&lt;p&gt;        $q = DQ::create()&lt;br/&gt;
         -&amp;gt;from(&apos;address a INNER JOIN a.shared b ON a.city = b.city AND a.street = b.street&apos;)&lt;br/&gt;
         -&amp;gt;innerJoin(&apos;b.entity e&apos;)&lt;br/&gt;
         -&amp;gt;where(&apos;a.entity_id = ? AND a.is_active = ?&apos;, array($id, $is_active))&lt;br/&gt;
         -&amp;gt;limit(5)&lt;br/&gt;
         -&amp;gt;offset(0);&lt;/p&gt;

&lt;p&gt;SQL looks like this:&lt;/p&gt;

&lt;p&gt;SELECT * FROM address a &lt;br/&gt;
INNER JOIN address a2 ON ((a.city = a2.city AND a.street = a2.street)) &lt;br/&gt;
INNER JOIN entity e ON a2.entity_id = e.id &lt;br/&gt;
WHERE a.id IN (&apos;5689677&apos;) AND (a.entity_id = ? AND a.is_active = ?)&lt;/p&gt;

&lt;p&gt;Problem: Limit 5 is gone&lt;/p&gt;

&lt;p&gt;expected was something like this:&lt;/p&gt;

&lt;p&gt;SELECT *&lt;br/&gt;
FROM address a&lt;br/&gt;
INNER JOIN address b ON a.city = b.city AND a.street = b.street &lt;br/&gt;
INNER JOIN entity e ON b.entity_id = e.id&lt;br/&gt;
where a.entity_id = 104294414&lt;br/&gt;
limit 5&lt;/p&gt;

&lt;p&gt;my temporary solution:&lt;/p&gt;

&lt;p&gt;        $q = new Doctrine_RawSql();&lt;br/&gt;
        $q-&amp;gt;select(&apos;&lt;/p&gt;
{b.*}
&lt;p&gt;, &lt;/p&gt;
{e.*}
&lt;p&gt;, &lt;/p&gt;
{p.*}
&lt;p&gt;&apos;);&lt;br/&gt;
        $q-&amp;gt;from(&apos;address a INNER JOIN address b ON a.city = b.city AND a.street = b.street&lt;br/&gt;
            INNER JOIN entity e ON b.entity_id = e.id&lt;br/&gt;
            INNER JOIN person p ON e.id = p.entity_id&apos;);&lt;br/&gt;
        $q-&amp;gt;where(&apos;a.entity_id = ? AND a.is_active = ?&apos;, array($id, $isActive));&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;a&apos;, &apos;address a&apos;);&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;b&apos;, &apos;a.shared b&apos;);&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;e&apos;, &apos;b.entity e&apos;);&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;p&apos;, &apos;e.person p&apos;);&lt;br/&gt;
        $q-&amp;gt;limit($limit);&lt;br/&gt;
        $q-&amp;gt;offset($offset);&lt;/p&gt;

&lt;p&gt;my schema.yml is attached, do you need anything else?&lt;/p&gt;</description>
                <environment>os x, snow leopard,</environment>
            <key id="10851">DC-485</key>
            <summary>Limit gets lost when doing self join</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="nicam">Pascal Helfenstein</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Feb 2010 10:53:16 +0000</created>
                <updated>Mon, 8 Feb 2010 11:06:41 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10357" name="schema.yml" size="2786" author="nicam" created="Mon, 8 Feb 2010 11:06:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-825] Versionable does not work with column alias on primary keys [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-825</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the Versionable behavior on a model which has a column with an alias and which is also primary causes the generation of a wrong version of the versionable table.&lt;/p&gt;

&lt;p&gt;Example:&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; 
ModelFoo:
  model_id as id
  username
  password
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Generates tables:&lt;br/&gt;
model_foo (model_id, username, password, version)&lt;br/&gt;
model_foo_version (id, model_id, userrname, password, version)&lt;/p&gt;

&lt;p&gt;It should be:&lt;br/&gt;
model_foo (model_id, username, password, version)&lt;br/&gt;
model_foo_version (model_id, userrname, password, version)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11768">DC-825</key>
            <summary>Versionable does not work with column alias on primary keys [+patch]</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="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Aug 2010 07:42:28 +0000</created>
                <updated>Wed, 25 Aug 2010 11:26:56 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13942" author="enrico" created="Fri, 13 Aug 2010 08:52:55 +0000"  >&lt;p&gt;TestCase and Fix&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-825&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-825&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13996" author="enrico" created="Wed, 18 Aug 2010 06:55:47 +0000"  >&lt;p&gt;The supplied patches are not up-to-date. Pls use &lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-825&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-825&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10738" name="0001-TestCase-for-issue-DC-825.patch" size="3855" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                    <attachment id="10739" name="0002-DC-825-fix-generation-of-the-versionable-table.patch" size="8407" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                    <attachment id="10740" name="0003-DC-825-fix-generation-of-model-classes-with-column-a.patch" size="1356" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-801] Multiple template implementation (setImpl)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-801</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I feel curios when looking setImpl code on Doctrine. It set like this:&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 setImpl($template, $class)
{
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_impl[$template] = $class;

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I&apos;ve made a template:&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 PersonTemplate &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Template
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() 
    {
        &lt;span class=&quot;code-comment&quot;&gt;//... Person fields (e.g. name, address, etc.)
&lt;/span&gt;    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now I create 2 class that implement PersonTemplate&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 Student &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 setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;PersonTemplate&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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 Teacher &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 setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;PersonTemplate&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then I set implementation on Doctrine_Manager:&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;Doctrine_Manager::getInstance()-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Student&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Teacher&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now isn&apos;t it only Teacher record recognized as implementation of PersonTemplate ( when we see from this code: $this-&amp;gt;_impl&lt;span class=&quot;error&quot;&gt;&amp;#91;$template&amp;#93;&lt;/span&gt; = $class; )&lt;/p&gt;

&lt;p&gt;So how we can implement a template into seperated different doctrine record?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11691">DC-801</key>
            <summary>Multiple template implementation (setImpl)</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="aristondarmayuda">B. Ariston Darmayuda</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 14:19:18 +0000</created>
                <updated>Sat, 28 Apr 2012 11:56:51 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17893" author="richhl" created="Sat, 28 Apr 2012 11:48:18 +0000"  >&lt;p&gt;As the doc says &quot;Tip The implementations for the templates can be set at manager, connection and even at the table level.&quot; it is supposed one can do:&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;Doctrine_Manager::getInstance()-&amp;gt;getTable(&apos;Student&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Student&apos;);
Doctrine_Manager::getInstance()-&amp;gt;getTable(&apos;Teacher&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Teacher&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but for me it throws an exception:&lt;/p&gt;

&lt;p&gt;&quot;Couldn&apos;t find concrete implementation for template PersonTemplate&quot;&lt;/p&gt;

&lt;p&gt;thx&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-795] Can&apos;t mix Soft and Hard deletes. Fix with patch provided.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-795</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I reported this bug on the symfony site, but after investigation i have found that it is actually a doctrine SoftDelete issue. &lt;a href=&quot;http://trac.symfony-project.org/ticket/8898&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8898&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have a sandbox replicating the problem here:&lt;br/&gt;
&lt;a href=&quot;http://dl.dropbox.com/u/8354765/sf_sandbox.zip&quot; class=&quot;external-link&quot;&gt;http://dl.dropbox.com/u/8354765/sf_sandbox.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the test:&lt;br/&gt;
./symfony test:unit Contact &lt;/p&gt;

&lt;p&gt;The issue is I want to hard delete my M-M link table and soft delete the parents. This fails. I believe it is to do with the fact that the relations to the parent are marked as Doctrine_Record::STATE_TCLEAN which when the SoftDelete calls save on the parent object this flag trys to reinsert the relations that it has deleted. Things go very wrong at this point and the connection is rolled back.&lt;/p&gt;

&lt;p&gt;The fix I have is the following, not sure what this would do to other things or not as I am not overly familiar with Doctrine internals...&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: Doctrine/Template/Listener/SoftDelete.php
===================================================================
--- Doctrine/Template/Listener/SoftDelete.php	(revision 12962)
+++ Doctrine/Template/Listener/SoftDelete.php	(working copy)
@@ -95,6 +95,7 @@
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function postDelete(Doctrine_Event $event)
     {
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;hardDelete&apos;]) {
+            $event-&amp;gt;getInvoker()-&amp;gt;clearRelated();
             $event-&amp;gt;getInvoker()-&amp;gt;save();
         }
     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This works even if the relations have been marked as SoftDelete.&lt;/p&gt;</description>
                <environment>Mac</environment>
            <key id="11661">DC-795</key>
            <summary>Can&apos;t mix Soft and Hard deletes. Fix with patch provided.</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="johnwards">John Wards</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 08:45:26 +0000</created>
                <updated>Wed, 21 Jul 2010 14:47:10 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13636" author="johnwards" created="Wed, 21 Jul 2010 08:50:28 +0000"  >&lt;p&gt;Formatting&lt;/p&gt;</comment>
                    <comment id="13642" author="jwage" created="Wed, 21 Jul 2010 13:46:26 +0000"  >&lt;p&gt;Does this patch pass the test suite?&lt;/p&gt;</comment>
                    <comment id="13643" author="johnwards" created="Wed, 21 Jul 2010 14:32:02 +0000"  >&lt;p&gt;I have run the test suite and got the same 8 failures with and without the patch. &lt;/p&gt;

&lt;p&gt;These are the failing tests:&lt;br/&gt;
Doctrine_Cache_Apc_TestCase&lt;br/&gt;
Doctrine_Cache_Abstract_TestCase&lt;br/&gt;
Doctrine_Ticket_1783_TestCase&lt;/p&gt;

&lt;p&gt;Anything obvious I need to do to get these working, other than enabling apc...&lt;/p&gt;</comment>
                    <comment id="13644" author="johnwards" created="Wed, 21 Jul 2010 14:47:10 +0000"  >&lt;p&gt;It seems to be passing all the tests that have SoftDelete in them however, so I would say that it is working as expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-758] CascadeDelete not work properly on Versionable and on the AuditLog</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-758</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&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; 
Schema:

Personal:
  actAs:
    Versionable:
      deleteVersions: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      cascadeDelete: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When you use this configuration and try to delete one of the record linked with the versionned one, an exception about foreign key is raised because the id of the versioned record has a foreign key to the id of the record.&lt;/p&gt;

&lt;p&gt;It&apos;s necessary to could work with cascadeDelete: false... because like that it&apos;s needed to use softDelete and the deleted record&apos;s will be stored on the version table, but with the advantage that you don&apos;t have the performance problem of soft delete behaviour.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>Mac OS X Snow Leopard, LAMP and Macports</environment>
            <key id="11535">DC-758</key>
            <summary>CascadeDelete not work properly on Versionable and on the AuditLog</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="jaimesuez">Jaime Suez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 13:54:37 +0000</created>
                <updated>Tue, 24 Aug 2010 12:55:48 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-974] generateFile = true - problematic implementation, see symfony ticket #4522</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-974</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;see &lt;a href=&quot;http://trac.symfony-project.org/ticket/4522&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/4522&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using a behaviour with generateFile=true, som eproblematic issues occur:&lt;/p&gt;

&lt;p&gt;Let&apos;s take for example i18n:&lt;/p&gt;

&lt;p&gt;schema.yml&lt;br/&gt;
...&lt;br/&gt;
actAs:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;text&amp;#93;&lt;/span&gt;&lt;br/&gt;
      generateFiles: true&lt;br/&gt;
      generatePath: &amp;lt;?php echo sfConfig::get(&apos;sf_lib_dir&apos;) ?&amp;gt;/model/doctrine/translations&lt;/p&gt;

&lt;p&gt;1) The translation model class and it&apos;s base class are not created with generate.php (aka symfony doctrine:build --model), but every time a translation model is used. This is not the expected behaviour, because &lt;br/&gt;
  a) this makes autoloading these classes impossible.&lt;br/&gt;
  b) the APC cache always sees a new change time, and recaches the fiels. This results in a quick fragmentation of the cache with segmentation faults in the long run.&lt;br/&gt;
2) The permissions for the created files are wrong. Normal executable php scripts should not be writable by the web server (admitting that with the current implementation, this is not problem, because the files are created again for each request)&lt;br/&gt;
3) The path is hard coded. This brakes deployment by svn update, and I would prefer not to build models on a production server.&lt;/p&gt;

&lt;p&gt;Proposal:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;generate the files at build model time&lt;/li&gt;
	&lt;li&gt;hopefully find a solution with the path&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I realize that most development resources are now in the new doctrine, but this issue (especially the apc fragmentation) is a huge problem for me. If you won&apos;t fix it, let me know, then I would try to propose a patch. I checked the code, and the building and behaviour internal part of doctrine are not too well documented, and my patch would be far from perfect. &lt;/p&gt;</description>
                <environment>symfony</environment>
            <key id="12400">DC-974</key>
            <summary>generateFile = true - problematic implementation, see symfony ticket #4522</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="geg">Georg</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 08:31:49 +0000</created>
                <updated>Thu, 17 Feb 2011 08:31:49 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1047] hardDelete not resetting flag if exception is thrown</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1047</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;To be honest I don&apos;t know wich version I have but I believe it to be 1.2.3&lt;/p&gt;

&lt;p&gt;The problem is pretty simple, I was trying to do a hardDelete and if it fails I would do a softDelete.&lt;br/&gt;
Example&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;try&lt;/span&gt; {
    $record-&amp;gt;hardDelete();
}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($e &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Connection_Mysql_Exception &amp;amp;&amp;amp; $e-&amp;gt;getPortableCode() == Doctrine_Core::ERR_CONSTRAINT) {
        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $record-&amp;gt;delete();
        }
        &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e1) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e1;
        }
    }
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But when the first exception is thrown from hardDelete() in Doctrine_Template_SoftDelete(line 84) the listener flag for hardDelete is not set to false, so if I try to do the delete, it will still behave as if it was a hardDelete.&lt;/p&gt;

&lt;p&gt;The solution would be catch the exception, reset the flag and rethrow it.&lt;br/&gt;
Patch attached&lt;/p&gt;

&lt;p&gt;Hope this info is enough.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13334">DC-1047</key>
            <summary>hardDelete not resetting flag if exception is thrown</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="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="lonewolf4">Lone Wolf</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Jan 2012 11:46:54 +0000</created>
                <updated>Fri, 6 Jan 2012 11:46:54 +0000</updated>
                                                                    <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11140" name="softdelete_exception.patch" size="645" author="lonewolf4" created="Fri, 6 Jan 2012 11:46:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-746] Sluggable canUpdate overridden after subsequent updates</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-746</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When allowing the user to manually change a slug using &apos;canUpdate&apos; the slug  reverts back to it&apos;s default generated value upon subsequent saves. Pre-Update on the Sluggable Listener Template seems to incorrectly decide to regenerate the default value.&lt;/p&gt;

&lt;p&gt;Example:&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;this&lt;/span&gt;-&amp;gt;actAs(&apos;Sluggable&apos;, array(&apos;unique&apos;=&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;fields&apos;=&amp;gt;array(&apos;title&apos;), &apos;canUpdate&apos;=&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;save();

echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;example-title&quot;&lt;/span&gt; (Correct)
&lt;/span&gt;
$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;slug = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt;;
$record-&amp;gt;save();

echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt; (Correct - First Save)
&lt;/span&gt;
$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;slug = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt;;
$record-&amp;gt;save();
echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;example-title&quot;&lt;/span&gt; (Incorrect - Subsequent Save. Has regenerated it&apos;s &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; slug and lost the user defined one - even though we have passed the users custom one to the object prior to saving it.).&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>WAMP stack - PHP 5.3</environment>
            <key id="11511">DC-746</key>
            <summary>Sluggable canUpdate overridden after subsequent updates</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="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="ppanther">Adam Benson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 01:09:26 +0000</created>
                <updated>Fri, 21 Jan 2011 11:41:17 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14530" author="caponica" created="Tue, 5 Oct 2010 11:09:20 +0000"  >&lt;p&gt;As far as I can see this is a problem with the logic in Sluggable::preUpdate() , I recently posted a comment about this here:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/d40c6ac733738d4a&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/d40c6ac733738d4a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In short, I think that the code should be changed from:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&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 preUpdate(Doctrine_Event $event)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;unique&apos;]) {
            $record = $event-&amp;gt;getInvoker();
            $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name || (
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                ! array_key_exists($name, $record-&amp;gt;getModified())
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($record-&amp;gt;$name) &amp;amp;&amp;amp;
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                array_key_exists($name, $record-&amp;gt;getModified()
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To this (i.e. remove the canUpdate conditions from the first inner if):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php (modified)&lt;/b&gt;&lt;/div&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 preUpdate(Doctrine_Event $event)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;unique&apos;]) {
            $record = $event-&amp;gt;getInvoker();
            $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) { &lt;span class=&quot;code-comment&quot;&gt;// i.e. remove the other conditions - you should only build the slug from other fields &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it&apos;s empty
&lt;/span&gt;                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
            &lt;span class=&quot;code-comment&quot;&gt;// possibly add an &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; !canUpdate then make sure the old value is preserved&quot;&lt;/span&gt; here
&lt;/span&gt;            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($record-&amp;gt;$name) &amp;amp;&amp;amp;
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                array_key_exists($name, $record-&amp;gt;getModified()
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have modified my local version of the Doctrine code to use this modification and it seems to (a) not have the problem you reported above and (b) generally work ok. However, I have not run the test suite against it.&lt;/p&gt;

&lt;p&gt;C&lt;/p&gt;</comment>
                    <comment id="14786" author="ppanther" created="Fri, 19 Nov 2010 02:11:29 +0000"  >&lt;p&gt;Updated affected versions&lt;/p&gt;</comment>
                    <comment id="14787" author="ppanther" created="Fri, 19 Nov 2010 02:13:54 +0000"  >&lt;p&gt;Thanks for the update Christian, perhaps you could share your fix as a patch?&lt;/p&gt;</comment>
                    <comment id="15154" author="jessovr" created="Fri, 21 Jan 2011 11:41:17 +0000"  >&lt;p&gt;Hi, I&apos;m working on a multilingue web portal with Symfony 1.4 and Doctrine 1.2.3, and man, your fix saves my life &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;br/&gt;
I use Sluggable slaved by i18n and without your fix Sluggable simply does not do the job, instead it messes up all slugs when updating, eventually you can&apos;t retrieve object anymore based on it. I would not set it as only minor bug ?&lt;br/&gt;
thanks, anyway.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>