<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue Jun 18 22:45:21 UTC 2013

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

<item>
            <title>[DC-1009] save() also updates fields which should not be</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1009</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I want to do a simple update like this :&lt;/p&gt;

&lt;p&gt; $batches = ExamResultsBatchTable::getInstance()-&amp;gt;retrieveByExamBatchStatus(ExamResultsBatch::valid_status_code);&lt;br/&gt;
foreach($batches as $batch)&lt;br/&gt;
{&lt;br/&gt;
        $batch-&amp;gt;setExamBatchStatusId($batchStatusId);&lt;br/&gt;
        $batch-&amp;gt;setStatusDate(date(&apos;Y-m-d&apos;));&lt;br/&gt;
        $batch-&amp;gt;save();&lt;br/&gt;
}&lt;br/&gt;
Only exam_batch_status_id and status_date should be updated (see screenshot before), but columns exam_batch_status_id ,status_date AND exam_subject_id are updated,with the same value (23) (screenshot after_with_save).&lt;/p&gt;

&lt;p&gt;If I run this:&lt;br/&gt;
        $toto = Doctrine_Query::create()&lt;br/&gt;
                       -&amp;gt;update(&apos;ExamResultsBatch erb&apos;)&lt;br/&gt;
                        -&amp;gt;set(&apos;erb.exam_batch_status_id&apos;, 23)&lt;br/&gt;
                        -&amp;gt;set(&apos;erb.status_date&apos;, date(&apos;Y-m-d&apos;))&lt;br/&gt;
                       &lt;del&gt;&amp;gt;where(&apos;erb.id = ?&apos; , $batch&lt;/del&gt;&amp;gt;getId())&lt;br/&gt;
                       -&amp;gt;execute(); &lt;br/&gt;
Everything is correctly done.&lt;/p&gt;

&lt;p&gt;here is the simpliest case.&lt;/p&gt;

&lt;p&gt;The same problems are signaled on other tables in the database, but different tables can be impacted by one save() (the execute() query still works fine).&lt;/p&gt;

&lt;p&gt;Example : 2 foreign tables will be updated , even if the save() action should only concern the main table, and one field (which is not a foreign key).&lt;br/&gt;
The corresponding foreign key fields in the 2 foreign tables, will be updated with the value given (here 23).&lt;/p&gt;

&lt;p&gt;Because save() is used in a lot of different places in our app, I need to find a solution to fix save(), or if not possible to override it to run a execute()like query.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;br/&gt;
Don&apos;t hesitate to ask if you want more details.&lt;/p&gt;

&lt;p&gt;Yan&lt;/p&gt;</description>
                <environment>Windows server 2003  PHP 5.2.17 / XP PRO 32bits XAMPP PHP 5.3.5&lt;br/&gt;
MSSQL / MYSQL&lt;br/&gt;
Symfony 1.4.6</environment>
            <key id="12702">DC-1009</key>
            <summary>save() also updates fields which should not be</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="karibusan">Yan Urquiza</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Jun 2011 15:24:12 +0000</created>
                <updated>Wed, 8 Jun 2011 15:40:42 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11012" name="after_with_execute.PNG" size="110183" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11011" name="after_with_save.PNG" size="110270" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11010" name="before.PNG" size="108968" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11014" name="retrieveByExamBatchStatus.php" size="1246" author="karibusan" created="Wed, 8 Jun 2011 15:29:50 +0000" />
                    <attachment id="11013" name="schema.yml" size="4243" author="karibusan" created="Wed, 8 Jun 2011 15:29:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>