<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 07:36:15 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-2148/DDC-2148.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-2148] Many-to-many not working with interface</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2148</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;First off, here&apos;s a pastie with all the code and mappings involved, and a stacktrace: &lt;a href=&quot;http://pastie.org/5372087&quot; class=&quot;external-link&quot;&gt;http://pastie.org/5372087&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not sure if this a bug or not, but I think that according to the docs this should work - in a vendor bundle I have an entity defining a unidirectional many-to-many relation to an interface: the entity is Group and defines a many-to-many relation to a UserInterface, which is resolved correctly in the app configuration (as the many-to-one relations using it in the other entities of this vendor bundle work fine).&lt;/p&gt;

&lt;p&gt;I&apos;m going by these docs:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://symfony.com/doc/master/cookbook/doctrine/resolve_target_entity.html&quot; class=&quot;external-link&quot;&gt;http://symfony.com/doc/master/cookbook/doctrine/resolve_target_entity.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, when adding a user to a group, I&apos;m getting a weird error:&lt;/p&gt;

&lt;p&gt;An exception occurred while executing &apos;INSERT INTO acme_group_user (group_id, user_id) VALUES (?, ?)&apos; with params &lt;/p&gt;
{&quot;1&quot;:2,&quot;2&quot;:1,&quot;3&quot;:2,&quot;4&quot;:1}
&lt;p&gt;:&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;

&lt;p&gt;For some reason it&apos;s adding 4 parameters to the statement instead of 2.&lt;/p&gt;

&lt;p&gt;Oddly enough, the query generation works perfectly fine when I replace the interface in the mapping with the actual final entity. But that wasn&apos;t the point of the exercise... &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; I need to use the interface there.&lt;/p&gt;

&lt;p&gt;Also, in other entities in that GroupBundle which are referencing the UserInterface using a different relation type, i.e. many-to-one, the relations work perfectly fine.&lt;/p&gt;

&lt;p&gt;The schema validates as well, using doctrine:schema:validate in the console.&lt;/p&gt;</description>
                <environment>Linux, PHP 5.3.10, Symfony 2.2</environment>
            <key id="14231">DDC-2148</key>
            <summary>Many-to-many not working with interface</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="userfriendly">Moritz Kraft</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Fri, 16 Nov 2012 09:55:13 +0000</created>
                <updated>Thu, 22 Nov 2012 14:28:35 +0000</updated>
                    <resolved>Thu, 22 Nov 2012 14:28:35 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.2</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18994" author="ocramius" created="Fri, 16 Nov 2012 09:59:07 +0000"  >&lt;p&gt;&quot;many-to-many TO a mapped superclass&quot;? I don&apos;t think relations TO mapped superclasses are supported in any way... A mapped superclass should never appear in a `targetEntity` mapping.&lt;/p&gt;

&lt;p&gt;Could you please re-formulate the description of the issue? There is no mapped superclass in your examples &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="18995" author="userfriendly" created="Fri, 16 Nov 2012 11:30:37 +0000"  >&lt;p&gt;You are of course right. Edited the issue description/title.&lt;/p&gt;

&lt;p&gt;It is a blocker for us, btw., not minor - being able to use a many-to-many relation there is rather central to the code of our app. I&apos;m not seeing a workaround, easy or otherwise.&lt;/p&gt;</comment>
                    <comment id="18999" author="ocramius" created="Fri, 16 Nov 2012 13:23:32 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=userfriendly&quot; class=&quot;user-hover&quot; rel=&quot;userfriendly&quot;&gt;Moritz Kraft&lt;/a&gt; yes, but it is not a blocker for the next release &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; Will restore prio.&lt;/p&gt;</comment>
                    <comment id="19002" author="userfriendly" created="Fri, 16 Nov 2012 13:38:51 +0000"  >&lt;p&gt;Ah right, yeah, that makes sense. &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; Thank you!&lt;/p&gt;</comment>
                    <comment id="19023" author="userfriendly" created="Thu, 22 Nov 2012 14:27:39 +0000"  >&lt;p&gt;Fixed in 1b5f051 - thanks Benjamin!&lt;/p&gt;</comment>
                    <comment id="19024" author="userfriendly" created="Thu, 22 Nov 2012 14:28:35 +0000"  >&lt;p&gt;Fixed in 2.3 branch, backported to 2.2 as well&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>