<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Mon May 20 17:10:51 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+AND+fixVersion+%3D+%221.2.0-ALPHA2%22&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DC+AND+fixVersion+%3D+%221.2.0-ALPHA2%22</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="7" total="7"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-80] Doctrine/Import/Pgsql.php generates wrong default values for varchar fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-80</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We run a postgres database and have generated out base models from the database. In the base models, we see the following issue:&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;hasColumn(&apos;contractor_type&apos;, &apos;string&apos;, 150, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;length&apos; =&amp;gt; &apos;150&apos;,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos; =&amp;gt; &apos;\&apos;enduser\&apos;::character varying&apos;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So, the default value is showing some PostgreSQL meta information. We fixed this by changing function listTableColumns():&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;if&lt;/span&gt; (preg_match(&lt;span class=&quot;code-quote&quot;&gt;&quot;/^nextval\(&apos;(.*)&apos;(::.*)?\)$/&quot;&lt;/span&gt;, $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;], $matches)) {

                $description[&apos;sequence&apos;] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;formatter-&amp;gt;fixSequenceName($matches[1]);
                $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
            }
+           elseif (preg_match(&lt;span class=&quot;code-quote&quot;&gt;&quot;/^&apos;(.*)&apos;::character varying$/&quot;&lt;/span&gt;, $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;], $matches)) {
+               $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = $matches[1];
+           }

            $columns[$val[&apos;field&apos;]] = $description;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu Linux, PostgreSQL 8.3, PHP 5.2.6</environment>
            <key id="10142">DC-80</key>
            <summary>Doctrine/Import/Pgsql.php generates wrong default values for varchar fields</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Oct 2009 06:23:38 +0000</created>
                <updated>Tue, 6 Oct 2009 18:13:42 +0000</updated>
                    <resolved>Tue, 6 Oct 2009 18:13:42 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-66] Saving &quot;new Doctrine_Expression(&apos;NOW()&apos;)&quot; to database doesn&apos;t work since r6403</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-66</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record:1469&lt;/p&gt;

&lt;p&gt;        } else if ($type == &apos;timestamp&apos; || $type == &apos;date&apos;) {&lt;br/&gt;
            return strtotime($old) !== strtotime($new);&lt;/p&gt;

&lt;p&gt;These new lines cause inability to save NOW() to &quot;date&quot; field.&lt;/p&gt;

&lt;p&gt;Change was commited in r6403 branch 1.2&lt;/p&gt;

&lt;p&gt;MySQL error is:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1364 Field &apos;date&apos; doesn&apos;t have a default value&lt;/p&gt;</description>
                <environment>MySQL 5.0.51, PHP 5.3</environment>
            <key id="10117">DC-66</key>
            <summary>Saving &quot;new Doctrine_Expression(&apos;NOW()&apos;)&quot; to database doesn&apos;t work since r6403</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mg">Marcin Gil</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Sep 2009 17:03:59 +0000</created>
                <updated>Tue, 6 Oct 2009 18:01:08 +0000</updated>
                    <resolved>Tue, 6 Oct 2009 18:01:08 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10134" author="lex" created="Sun, 27 Sep 2009 23:01:45 +0000"  >&lt;p&gt;Possible fix attached.&lt;/p&gt;</comment>
                    <comment id="10135" author="mg" created="Mon, 28 Sep 2009 06:45:18 +0000"  >&lt;p&gt;The patch is effective, please apply to SVN.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="10139" author="jowe" created="Mon, 28 Sep 2009 14:27:40 +0000"  >&lt;p&gt;I don&apos;t want to rewrite all my &quot;NOW()&quot; values! Please fix this ASAP!&lt;br/&gt;
thx!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10043" name="timestamp-validation.patch" size="627" author="lex" created="Sun, 27 Sep 2009 23:01:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-57] isValueModified returns true for timestamps that appear different but are equal</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-57</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record::isValueModified compares timestamps as strings and values that are equal such as 2009-09-02 00:00:00 and 2009-09-02 are treated as modified.&lt;/p&gt;

&lt;p&gt;The code should do a second compare on the strtotime value if the strings appear to be unequal.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10106">DC-57</key>
            <summary>isValueModified returns true for timestamps that appear different but are equal</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 17:45:36 +0000</created>
                <updated>Mon, 15 Feb 2010 11:20:45 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 17:55:00 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11727" author="oweitman" created="Mon, 15 Feb 2010 11:20:45 +0000"  >&lt;p&gt;Problem is with date-values before Fri, 13 Dec 1901 20:45:54 GMT&lt;br/&gt;
and after Tue, 19 Jan 2038 03:14:07 GMT. &lt;br/&gt;
For these values  strtotime reports false and the field is not updated.&lt;/p&gt;

&lt;p&gt;This is my first use of this issue-system, i dont find a button to reopen this issue. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-56] Geographical behavior does not calculate distance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-56</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>

&lt;p&gt;If the fields name of the latitude or longitude invoker aren&apos;t &apos;latitude&apos; or &apos;longitude&apos;, then the getDistanceQuery doesn&apos;t not work.&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;milesSql = sprintf($sql, $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;longitude&apos;), &apos;1.1515&apos;, &apos;miles&apos;);
...
$kilometersSql = sprintf($sql, $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;longitude&apos;), &apos;1.1515 * 1.609344&apos;, &apos;kilometers&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Replacing latitude by $latName (previously defined line 74 and 75) resolved this problem.&lt;/p&gt;

&lt;p&gt;Here&apos;s the fix :&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;
milesSql = sprintf($sql, $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($longName), &apos;1.1515&apos;, &apos;miles&apos;);
...
$kilometersSql = sprintf($sql, $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($longName), &apos;1.1515 * 1.609344&apos;, &apos;kilometers&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10105">DC-56</key>
            <summary>Geographical behavior does not calculate distance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 17:16:41 +0000</created>
                <updated>Mon, 1 Mar 2010 16:12:04 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 17:39:22 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11898" author="jwage" created="Mon, 1 Mar 2010 16:12:04 +0000"  >&lt;p&gt;This is fixed already in the latest 1.2 version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-40] Problems with alias in where section</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-40</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using a mysql function to calculate the distance between 2 points. When I&apos;m using this funciton in a doctrine query it works. But when I&apos;m using the functions result in a where clause it dont work:&lt;/p&gt;

&lt;p&gt;The Query:&lt;br/&gt;
$basicQuery = $query-&amp;gt;select(&apos;id, getGeoDistanceKM(lng, lat, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lng&amp;#39;&amp;#93;&lt;/span&gt;.&apos;, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lat&amp;#39;&amp;#93;&lt;/span&gt;.&apos;) AS distance, getGeoDistanceKM(lng, lat, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lng&amp;#39;&amp;#93;&lt;/span&gt;.&apos;, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lat&amp;#39;&amp;#93;&lt;/span&gt;.&apos;) AS distance, IF(count(r.id) &amp;gt; 0, AVG(r.rating), 0) as ratingAvg&apos;)&lt;br/&gt;
			-&amp;gt;from(&apos;ProomsOffer o&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.PublicTransports pt&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.Unavailabilities ua&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.Ratings r&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.Bookings b&apos;)&lt;br/&gt;
			-&amp;gt;where(&apos;distance != 0&apos;)&lt;br/&gt;
			-&amp;gt;groupBy(&apos;o.id&apos;)&lt;br/&gt;
			-&amp;gt;orderBy(&apos;distance, ratingAvg&apos;);&lt;/p&gt;

&lt;p&gt;The Error message:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;m__1&apos; in &apos;where clause&apos;&lt;br/&gt;
#0 /Applications/MAMP/htdocs/prooms/cms/library/Doctrine/Doctrine/Connection.php(1015): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql))&lt;br/&gt;
#1 /Applications/MAMP/htdocs/prooms/cms/library/Doctrine/Doctrine/Connection.php(790): Doctrine_Connection-&amp;gt;execute(&apos;SELECT COUNT&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;...&apos;, Array)&lt;br/&gt;
#2 /Applications/MAMP/htdocs/prooms/cms/library/Doctrine/Doctrine/Query.php(2037): Doctrine_Connection-&amp;gt;fetchAll(&apos;SELECT COUNT&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;...&apos;, Array)&lt;br/&gt;
#3 /Applications/MAMP/htdocs/prooms/cms/application/modules/prooms/controllers/SearchController.php(163): Doctrine_Query-&amp;gt;count()&lt;br/&gt;
#4 /Applications/MAMP/htdocs/prooms/cms/library/Zend/Controller/Action.php(513): Prooms_SearchController-&amp;gt;searchAction()&lt;br/&gt;
#5 /Applications/MAMP/htdocs/prooms/cms/library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action-&amp;gt;dispatch(&apos;searchAction&apos;)&lt;br/&gt;
#6 /Applications/MAMP/htdocs/prooms/cms/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(CMS_Controller_Request), Object(Zend_Controller_Response_Http))&lt;br/&gt;
#7 /Applications/MAMP/htdocs/prooms/cms/library/CMS/Application.php(372): Zend_Controller_Front-&amp;gt;dispatch()&lt;br/&gt;
#8 /Applications/MAMP/htdocs/prooms/cms/library/CMS/Application.php(241): CMS_Application-&amp;gt;_dispatch(Object(Zend_Controller_Front))&lt;br/&gt;
#9 /Applications/MAMP/htdocs/prooms/cms/public/index.php(50): CMS_Application-&amp;gt;run()&lt;br/&gt;
#10 &lt;/p&gt;
{main}
&lt;p&gt; &lt;/p&gt;


&lt;p&gt;The getSqlQuery:&lt;br/&gt;
SELECT `m`.`id` AS `m_&lt;em&gt;id`, getGeoDistanceKM(`m`.`lng`, `m`.`lat`, 48.2092062, 16.3727778) AS `m&lt;/em&gt;&lt;em&gt;0`, getGeoDistanceKM(`m`.`lng`, `m`.`lat`, 48.2092062, 16.3727778) AS `m&lt;/em&gt;&lt;em&gt;1`, IF(COUNT(`m4`.`id`) &amp;gt; 0, AVG(`m4`.`rating`), 0) AS `m4&lt;/em&gt;&lt;em&gt;1` FROM `module_prooms_offers` `m` LEFT JOIN `module_prooms_offers_public_transport` `m2` ON `m`.`id` = `m2`.`id_offer` LEFT JOIN `module_prooms_offers_unavailability` `m3` ON `m`.`id` = `m3`.`id_offer` LEFT JOIN `module_prooms_offers_ratings` `m4` ON `m`.`id` = `m4`.`id_offer` LEFT JOIN `module_prooms_bookings` `m5` ON `m`.`id` = `m5`.`id_offer` WHERE `m&lt;/em&gt;&lt;em&gt;1` != 0 GROUP BY `m`.`id` ORDER BY `m&lt;/em&gt;&lt;em&gt;1`, `m4&lt;/em&gt;_1`&lt;/p&gt;</description>
                <environment>MAMP</environment>
            <key id="10085">DC-40</key>
            <summary>Problems with alias in where section</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="jowe">Johannes Weber</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Sep 2009 14:16:50 +0000</created>
                <updated>Thu, 24 Sep 2009 19:57:46 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 19:57:46 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10115" author="guilhermeblanco" created="Thu, 24 Sep 2009 19:57:46 +0000"  >&lt;p&gt;You must disable PORTABILITY_EXPR in order to get it working correcrly.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-29] ResultCache not working with i18n behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-29</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;b&gt;Tested with Doctrine_Cache_APC and Doctrine_Cache_Db with SQLite.&lt;/b&gt;&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;The model:&lt;/li&gt;
&lt;/ul&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-xml&quot;&gt;Article:
  actAs:
    Timestampable:
    Sluggable:
      fields:   [date, title]
    I18n:
      fields:       [title, content]
      actAs:
        Sluggable:
          fields:   [title]
          uniqueBy: [lang, title]
  columns:
    title:          string(255)
    date:           date
    content:        clob
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;The symfony code:&lt;/li&gt;
&lt;/ul&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;frontendConfiguration.class.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 configureDoctrine(Doctrine_Manager $manager)
{
  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (sfConfig::get(&apos;sf_cache&apos;) == &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
  {
    $cacheDriver = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Cache_Apc();
    
    $manager-&amp;gt;setAttribute(Doctrine::ATTR_QUERY_CACHE, $cacheDriver);
    $manager-&amp;gt;setAttribute(
      Doctrine::ATTR_QUERY_CACHE_LIFESPAN,
      sfConfig::get(&apos;app_cache_lifetime&apos;, 86000)
    );
    $manager-&amp;gt;setAttribute(Doctrine::ATTR_RESULT_CACHE, $cacheDriver);
    $manager-&amp;gt;setAttribute(
      Doctrine::ATTR_RESULT_CACHE_LIFESPAN,
      sfConfig::get(&apos;app_cache_lifetime&apos;, 86000)
    );
  }
}
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;ArticleTable.class.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 fetchAll()
{
  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Query::create()
    -&amp;gt;from(&apos;Article a&apos;)
    -&amp;gt;leftJoin(&apos;a.Translation t&apos;)
    -&amp;gt;orderby(&apos;a.date DESC&apos;)
    -&amp;gt;useQueryCache()-&amp;gt;useResultCache()
    -&amp;gt;execute();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;The Result:&lt;/li&gt;
&lt;/ul&gt;


&lt;blockquote&gt;
&lt;p&gt;500 | Internal Server Error | Doctrine_Record_UnknownPropertyException&lt;br/&gt;
Unknown record property / related component &quot;title&quot; on &quot;Article&quot;&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment>ubuntu 8.04 apache2 php5 with symfony</environment>
            <key id="10074">DC-29</key>
            <summary>ResultCache not working with i18n 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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ju1ius">Jules Bernable</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Sep 2009 10:30:33 +0000</created>
                <updated>Sat, 26 Sep 2009 07:44:05 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 14:32:34 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10075" author="jwage" created="Thu, 17 Sep 2009 23:49:08 +0000"  >&lt;p&gt;Would it be possible to have a test case included?&lt;/p&gt;</comment>
                    <comment id="10093" author="ju1ius" created="Sat, 19 Sep 2009 21:08:52 +0000"  >&lt;p&gt;Well, i&apos;m new to Doctrine so I wasn&apos;t able to run the test case, but I tried to write one. :-/&lt;br/&gt;
Hope this helps...&lt;/p&gt;</comment>
                    <comment id="10108" author="jwage" created="Thu, 24 Sep 2009 14:32:34 +0000"  >&lt;p&gt;The problem is that you define Sluggable on the root model for the fields named title and date. But you said that title is to be I18n so no field exists named title since it was moved to the translation table. You could work around it by creating a getTitle() accessor proxy which gets the title from the translation.&lt;/p&gt;</comment>
                    <comment id="10128" author="ju1ius" created="Fri, 25 Sep 2009 16:01:14 +0000"  >&lt;p&gt;Yes, but the sfDoctrineRecordI18nFilter class is supposed to handle this for me,&lt;br/&gt;
and the fact is that it works fine excepted when the Result_Cache is enabled.&lt;br/&gt;
Should I file a bug in the symfony trac then ?&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;symfony/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecordI18nFilte.class.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * sfDoctrineRecordI18nFilter &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; access to the translated properties &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;
 * the current culture from the internationalized model.
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;    symfony
 * @subpackage doctrine
 * @author     Jonathan H. Wage &amp;lt;jonwage@gmail.com&amp;gt;
 * @version    SVN: $Id: sfDoctrineRecordI18nFilter.class.php 11878 2008-09-30 20:14:40Z Jonathan.Wage $
 */
class sfDoctrineRecordI18nFilter &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record_Filter
{
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function init()
  {
  }

  /**
   * Implementation of filterSet() to call set on Translation relationship to allow
   * access to I18n properties from the main object.
   *
   * @param Doctrine_Record $record
   * @param string $name Name of the property
   * @param string $value Value of the property
   * @&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 filterSet(Doctrine_Record $record, $name, $value)
  {
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $record[&apos;Translation&apos;][sfDoctrineRecord::getDefaultCulture()][$name] = $value;
  }

  /**
   * Implementation of filterGet() to call get on Translation relationship to allow
   * access to I18n properties from the main object.
   *
   * @param Doctrine_Record $record
   * @param string $name Name of the property
   * @param string $value Value of the property
   * @&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 filterGet(Doctrine_Record $record, $name)
  {
    $culture = sfDoctrineRecord::getDefaultCulture();
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($record[&apos;Translation&apos;][$culture]))
    {
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $record[&apos;Translation&apos;][$culture][$name];
    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
      $defaultCulture = sfConfig::get(&apos;sf_default_culture&apos;);
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $record[&apos;Translation&apos;][$defaultCulture][$name];
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="10129" author="jwage" created="Fri, 25 Sep 2009 16:29:09 +0000"  >&lt;p&gt;Ahhh. I see. I think this could be a problem with serializing and unserializing and the attached filters are not being maintained when unserialized. Not sure, i will have to have a look.&lt;/p&gt;</comment>
                    <comment id="10133" author="ju1ius" created="Sat, 26 Sep 2009 07:44:05 +0000"  >&lt;p&gt;linked ...&lt;br/&gt;
&lt;a href=&quot;http://trac.symfony-project.org/ticket/7220&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7220&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10031" name="Doctrine_Ticket_DC29.php" size="3504" author="ju1ius" created="Sat, 19 Sep 2009 21:08:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-28] Duplicate join condition when using nestedSet </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-28</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to fetch a nested set tree, where a base query uses join, an exception is thrown &quot;&apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&apos;&quot;, which is caused by incorrect generated SQL query.&lt;/p&gt;

&lt;p&gt;How to reproduce:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = Doctrine_Query::create()
            -&amp;gt;select(&apos;s.name&apos;)
            -&amp;gt;from(&apos;Test s&apos;)
            -&amp;gt;leftJoin(&apos;s.Test2 st WITH st.title = ?&apos;, array(1));

$tree_table = Doctrine::getTable(&apos;Test&apos;);
$tree = $tree_table-&amp;gt;getTree();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;viewing SQL at this point, is:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; t.id AS t__id, t.name AS t__name 
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; test t 
LEFT JOIN test_2 t2 
    ON t.id = t2.test_id AND (t2.title = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;set the query as a base for nestedSet tree:&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;$tree-&amp;gt;setBaseQuery($query);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;viewing SQL at this point, is:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; t.id AS t__id, t.name AS t__name, t.lft AS t__lft, t.rgt AS t__rgt, t.level AS t__level 
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; test t 
LEFT JOIN test_2 t2 
    ON t.id = t2.test_id AND (t2.title = ?) AND (t2.title = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see lft/rgt/level fields were added, which is ok, but also additional LEFT JOIN condition was duplicated  - (t2.title = ?) .&lt;/p&gt;


&lt;p&gt;These kind of queries are working in 1.0* branch and also seemed to work in 1.1* branch until 5680 revision, which broke it. Although &lt;a href=&quot;http://trac.doctrine-project.org/changeset/5700&quot; class=&quot;external-link&quot;&gt;Changeset 5700&lt;/a&gt; seems to must have fixed it, but the SQL is still generated doubled in 1.1* and 1.2* branches.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10073">DC-28</key>
            <summary>Duplicate join condition when using nestedSet </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="torin">Viktoras</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Sep 2009 05:55:27 +0000</created>
                <updated>Thu, 24 Sep 2009 15:13:59 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 15:13:59 +0000</resolved>
                            <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.1.4</fixVersion>
                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Nested Set</component>
                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10040" author="extreme" created="Wed, 16 Sep 2009 06:57:46 +0000"  >&lt;p&gt;TestCase from ticket 2105 (which was fixed in rev. 5700) works ok. (BTW. It was my ticket &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;/p&gt;

&lt;p&gt;Create a failing testcase for that, it will help devs.&lt;/p&gt;</comment>
                    <comment id="10042" author="torin" created="Wed, 16 Sep 2009 11:07:44 +0000"  >&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 Doctrine_Ticket_Dc28_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase 
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareTables()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_Dc28_Tree&apos;;
        parent::prepareTables();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testQuery()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $q = Doctrine_Query::create()
                -&amp;gt;select(&apos;a.id, t.lang&apos;)
                -&amp;gt;from(&apos;Ticket_Dc28_Tree a&apos;)
                -&amp;gt;innerJoin(&apos;a.Translation t WITH t.name != ?&apos;, &apos;test&apos;)
                ;
            $q-&amp;gt;execute();
            &lt;span class=&quot;code-comment&quot;&gt;//echo $q-&amp;gt;getSql().PHP_EOL;
&lt;/span&gt;            
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual(
                $q-&amp;gt;getSql(), 
                &apos;SELECT t.id AS t__id, t2.id AS t2__id, t2.lang AS t2__lang &apos;.
                &apos;FROM ticket__dc28__tree t &apos;.
                &apos;INNER JOIN ticket__dc28__tree_translation t2 &apos;.
                &apos;ON t.id = t2.id AND (t2.name != ?)&apos;
            );
            
            &lt;span class=&quot;code-comment&quot;&gt;//echo $q-&amp;gt;getSql().PHP_EOL;
&lt;/span&gt;            $tree_table = Doctrine::getTable(&apos;Ticket_Dc28_Tree&apos;);
            $tree = $tree_table-&amp;gt;getTree();
            $tree-&amp;gt;setBaseQuery($q);
            &lt;span class=&quot;code-comment&quot;&gt;//echo $q-&amp;gt;getSql().PHP_EOL;
&lt;/span&gt;            
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual(
                $q-&amp;gt;getSql(), 
                &apos;SELECT t.id AS t__id, t.lft AS t__lft, t.rgt AS t__rgt, t.level AS t__level, t2.id AS t2__id, t2.lang AS t2__lang &apos;.
                &apos;FROM ticket__dc28__tree t &apos;.
                &apos;INNER JOIN ticket__dc28__tree_translation t2 &apos;.
                &apos;ON t.id = t2.id AND (t2.name != ?)&apos;
            );
            
            &lt;span class=&quot;code-comment&quot;&gt;//$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;pass();
&lt;/span&gt;        } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;fail($e-&amp;gt;getMessage());
        }
    }
}

class Ticket_Dc28_Tree &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 255);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $i18n = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Template_I18n(array(&apos;fields&apos; =&amp;gt; array(0 =&amp;gt; &apos;name&apos;)));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs($i18n);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;NestedSet&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10109" author="jwage" created="Thu, 24 Sep 2009 15:13:59 +0000"  >&lt;p&gt;This is now fixed in Doctrine 1.1 and 1.1.&lt;/p&gt;

&lt;p&gt;1.0 is not affected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>