<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 17:33:30 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/DDC-1939/DDC-1939.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>[DDC-1939] Trying to save ManyToMany relatrionship</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1939</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When i try to save a many to many relationship i have to following error&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getOwner() on a non-object in  Doctrine/ORM/Persisters/ManyToManyPersister.php on line 181&lt;/p&gt;

&lt;p&gt;It tries to call getOwner on the following array ($mapping)&lt;/p&gt;

&lt;p&gt;array(19) {&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;fieldName&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; string(10) &quot;privileges&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;joinTable&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(4) {&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;name&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; string(36) &quot;fsbackend.user_mch_account_privilege&quot;&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;schema&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; NULL&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;joinColumns&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(2) {&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; array(6) &lt;/p&gt;
{
        [&quot;name&quot;] =&amp;gt; string(13) &quot;mch_accountid&quot;
        [&quot;referencedColumnName&quot;] =&amp;gt; string(13) &quot;mch_accountid&quot;
        [&quot;unique&quot;] =&amp;gt; bool(false)
        [&quot;nullable&quot;] =&amp;gt; bool(true)
        [&quot;onDelete&quot;] =&amp;gt; NULL
        [&quot;columnDefinition&quot;] =&amp;gt; NULL
      }
&lt;p&gt;      &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; =&amp;gt; array(6) &lt;/p&gt;
{
        [&quot;name&quot;] =&amp;gt; string(3) &quot;uid&quot;
        [&quot;referencedColumnName&quot;] =&amp;gt; string(3) &quot;uid&quot;
        [&quot;unique&quot;] =&amp;gt; bool(false)
        [&quot;nullable&quot;] =&amp;gt; bool(true)
        [&quot;onDelete&quot;] =&amp;gt; NULL
        [&quot;columnDefinition&quot;] =&amp;gt; NULL
      }
&lt;p&gt;    }&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;inverseJoinColumns&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(1) {&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; array(6) &lt;/p&gt;
{
        [&quot;name&quot;] =&amp;gt; string(10) &quot;resourceid&quot;
        [&quot;referencedColumnName&quot;] =&amp;gt; string(10) &quot;resourceid&quot;
        [&quot;unique&quot;] =&amp;gt; bool(false)
        [&quot;nullable&quot;] =&amp;gt; bool(true)
        [&quot;onDelete&quot;] =&amp;gt; NULL
        [&quot;columnDefinition&quot;] =&amp;gt; NULL
      }
&lt;p&gt;    }&lt;br/&gt;
  }&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;targetEntity&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; string(21) &quot;Entity\User\Privilege&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;mappedBy&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; NULL&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;inversedBy&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; NULL&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;cascade&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(0) {&lt;br/&gt;
  }&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;indexBy&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; string(10) &quot;resourceid&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;fetch&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; int(2)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;type&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; int(8)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isOwningSide&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; bool(true)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;sourceEntity&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; string(26) &quot;Entity\Merchant\Membership&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeRemove&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadePersist&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeRefresh&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeMerge&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeDetach&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;relationToSourceKeyColumns&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(2) &lt;/p&gt;
{
    [&quot;mch_accountid&quot;] =&amp;gt; string(13) &quot;mch_accountid&quot;
    [&quot;uid&quot;] =&amp;gt; string(3) &quot;uid&quot;
  }
&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;joinTableColumns&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(3) &lt;/p&gt;
{
    [0] =&amp;gt; string(13) &quot;mch_accountid&quot;
    [1] =&amp;gt; string(3) &quot;uid&quot;
    [2] =&amp;gt; string(10) &quot;resourceid&quot;
  }
&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;relationToTargetKeyColumns&amp;quot;&amp;#93;&lt;/span&gt; =&amp;gt; array(1) &lt;/p&gt;
{
    [&quot;resourceid&quot;] =&amp;gt; string(10) &quot;resourceid&quot;
  }
&lt;p&gt;}&lt;/p&gt;</description>
                <environment></environment>
            <key id="13874">DDC-1939</key>
            <summary>Trying to save ManyToMany relatrionship</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="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="yokoloko">Jeremie Tom tom</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Jul 2012 10:21:04 +0000</created>
                <updated>Sun, 29 Jul 2012 07:32:46 +0000</updated>
                    <resolved>Sun, 29 Jul 2012 07:32:46 +0000</resolved>
                            <version>2.2</version>
                                <fixVersion>2.2.3</fixVersion>
                <fixVersion>2.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18369" author="ocramius" created="Mon, 23 Jul 2012 10:30:37 +0000"  >&lt;p&gt;Can you try to replace your cache with an `ArrayCache` and see if the problem may come from there?&lt;br/&gt;
It would also be interesting to see your bootstrap code and the code you use to interact with the collection.&lt;/p&gt;</comment>
                    <comment id="18370" author="yokoloko" created="Mon, 23 Jul 2012 11:56:54 +0000"  >&lt;p&gt;I&apos;m already using an ArrayCache for my cache.&lt;/p&gt;

&lt;p&gt;Also for my bootstrap I&apos;m using this implementation of it : &lt;a href=&quot;https://github.com/guilhermeblanco/ZendFramework1-Doctrine2&quot; class=&quot;external-link&quot;&gt;https://github.com/guilhermeblanco/ZendFramework1-Doctrine2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is how i interact with the collection.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$collection-&amp;gt;clear();&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;foreach ($values as $value) {&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;$collection-&amp;gt;add(&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;$this-&amp;gt;_em-&amp;gt;getReference(&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&apos;Entity\User\Privilege&apos;,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;$value&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;));&lt;/tt&gt;}&lt;/p&gt;

&lt;p&gt;... Later on ...&lt;br/&gt;
... I have an entity $userAccount with many memberships set to Cascade persist, ....&lt;br/&gt;
... and on the membership entity relationship i have my collection ...&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$this-&amp;gt;_em-&amp;gt;persist($userAccount);&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;$this-&amp;gt;_em-&amp;gt;flush();&lt;/tt&gt;&lt;/p&gt;
</comment>
                    <comment id="18371" author="yokoloko" created="Tue, 24 Jul 2012 07:52:58 +0000"  >&lt;p&gt;I don&apos;t know if it helps but it works if I replace $mapping with $coll on line 181 : &lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$sourceClass = $this-&amp;gt;_em-&amp;gt;getClassMetadata(get_class($mapping-&amp;gt;getOwner()));&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Replaced by :&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$sourceClass = $this-&amp;gt;_em-&amp;gt;getClassMetadata(get_class($coll-&amp;gt;getOwner()));&lt;/tt&gt;&lt;/p&gt;</comment>
                    <comment id="18372" author="ocramius" created="Tue, 24 Jul 2012 09:31:33 +0000"  >&lt;p&gt;Looks like code coming from the (removed) AssociationMapping class. The fix seems also to be valid. I&apos;m patching this.&lt;/p&gt;</comment>
                    <comment id="18373" author="ocramius" created="Tue, 24 Jul 2012 09:43:07 +0000"  >&lt;p&gt;Nevermind, I don&apos;t think this needs a test. It is just something overlooked during a refactoring. Being handled at &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1941&quot; title=&quot;[GH-407] DDC-1939 - Removing references to non-existing AssociationMapping class&quot;&gt;&lt;del&gt;DDC-1941&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18374" author="ocramius" created="Tue, 24 Jul 2012 09:57:34 +0000"  >&lt;p&gt;Could you please provide the models anyway? It would be interesting to see why the test suite doesn&apos;t cover that part &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;
Thank you!&lt;/p&gt;</comment>
                    <comment id="18375" author="yokoloko" created="Tue, 24 Jul 2012 12:36:54 +0000"  >&lt;p&gt;Ok I attached it. Tell me if you need more informations i didn&apos;t upload the full models. But just the parts i thought were relevant.&lt;/p&gt;</comment>
                    <comment id="18394" author="beberlei" created="Sun, 29 Jul 2012 07:32:46 +0000"  >&lt;p&gt;Fixed and applied to 2.2.3 and 2.3&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11210" name="Membership.php" size="968" author="yokoloko" created="Tue, 24 Jul 2012 12:36:54 +0000" />
                    <attachment id="11212" name="Privileges.php" size="332" author="yokoloko" created="Tue, 24 Jul 2012 12:36:54 +0000" />
                    <attachment id="11211" name="UserAccount.php" size="627" author="yokoloko" created="Tue, 24 Jul 2012 12:36:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>