<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 08:01:42 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-419/DC-419.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-419] Sluggable and inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-419</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve the same problem than this post : &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/3737fd293fef5fda/d86a8bc2578e4bac&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/3737fd293fef5fda/d86a8bc2578e4bac&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, I&apos;ve set  &quot;uniqueBy: &lt;span class=&quot;error&quot;&gt;&amp;#91;name, type&amp;#93;&lt;/span&gt; &quot;, and my data goes in database BUT they can have the same slug.&lt;/p&gt;

&lt;p&gt;So I can&apos;t retrieve an objects wich has equal slug with another.&lt;/p&gt;

&lt;p&gt;The column aggregation inheritance does&apos;nt take care of others slugs.&lt;/p&gt;</description>
                <environment>Symfony 1.4.1 LAMP</environment>
            <key id="10714">DC-419</key>
            <summary>Sluggable 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="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="pier">Pierre B</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 22:43:38 +0000</created>
                <updated>Tue, 6 Sep 2011 08:52:11 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:11:27 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11885" author="jan.misek" created="Mon, 1 Mar 2010 12:08:12 +0000"  >&lt;p&gt;First, inheritance is great feature, thanks doctrine team.&lt;/p&gt;

&lt;p&gt;But I have this problem too.  &lt;/p&gt;

&lt;p&gt;I have identified, the problem is related to class: &quot;Doctrine_Template_Listener_Sluggable&quot;, to method: getUniqueSlug($record, $slugFromFields). In mentioned method, table is retrieved from $record ($record-&amp;gt;getTable()), but record could be inherited class, so query result on the table is limited only to records of the inherited class.  But there could be already rows of other inherited classes with same slug in the database.&lt;/p&gt;

&lt;p&gt;Fast hack to solve it, works for me:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Added option variable to behaviour  &quot;table&quot;&lt;/li&gt;
	&lt;li&gt;Replaced all calls $record-&amp;gt;getTable() as Doctrine::getTable($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;)&lt;/li&gt;
&lt;/ul&gt;





</comment>
                    <comment id="11979" author="ivarne" created="Tue, 2 Mar 2010 13:49:34 +0000"  >&lt;p&gt;Thanks for the solution. I do not like the idea of patching the core framework, but it&apos;s just how we will have to deal with it. I hope someone will comment on this bugreport so that I&apos;ll be informed when the issue is fixed.&lt;/p&gt;

&lt;p&gt;The point of sluggable with column aggregation inheritance is to have a unique identifier to make a common interface for all entitis. Like /events/:slug where the presentation is dependent on the modell. &lt;br/&gt;
Ofcourse I could have set up one route for every child class, but that will make more code for configuration, whitch is a pain to maintain.&lt;/p&gt;</comment>
                    <comment id="11983" author="jwage" created="Tue, 2 Mar 2010 14:00:30 +0000"  >&lt;p&gt;Can anyone provide a patch for the change so I can see everything clearly? Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12000" author="ivarne" created="Wed, 3 Mar 2010 07:22:35 +0000"  >&lt;p&gt;Here is a simple patch implementing the changes Jan M&#237;&#353;ek proposed. (as far as I understod them)&lt;/p&gt;

&lt;p&gt;To make the solution better, it would be nice if the Behaviour somhow found out that it was a child class (without requirering me to specify the parent ) and made sure that it made a slug unique across all subclases, unless the unique by setting spesified the type column. I&apos;m realy glad I had a lot of data to import from a previous site, so that I discovered this bug. I use column aggregation inheritance to make the code for presenting different events in a different way simple. But every event sholud be accessable trough the same route mysite.com/events/:slug.&lt;/p&gt;</comment>
                    <comment id="12007" author="ivarne" created="Wed, 3 Mar 2010 12:18:00 +0000"  >&lt;p&gt;I hope this patch and test cases solves more than my problems.&lt;/p&gt;</comment>
                    <comment id="12030" author="ivarne" created="Thu, 4 Mar 2010 08:37:02 +0000"  >&lt;p&gt;Updated the patch a little, so that it does not try to instanciate an abstract class as doctrine generates them.&lt;/p&gt;

&lt;p&gt;I was walking up the inheritance tree and tried to instanciate the class right under DoctrineRecord unfortunatly in symfony there is many layers of abstract classes before you find the base class. Now the plugin walks back to the highes not abstract class&lt;/p&gt;</comment>
                    <comment id="12207" author="jwage" created="Mon, 15 Mar 2010 14:11:27 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                    <comment id="12610" author="klemens_u" created="Fri, 9 Apr 2010 08:12:36 +0000"  >&lt;p&gt;This fix breaks my system.&lt;/p&gt;

&lt;p&gt;@see: &lt;a href=&quot;http://groups.google.com/group/doctrine-dev/browse_thread/thread/8028e51d5bde27eb&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-dev/browse_thread/thread/8028e51d5bde27eb&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="12611" author="ivarne" created="Fri, 9 Apr 2010 09:19:55 +0000"  >&lt;p&gt;Hmm.. I&apos;m sory that my ugly fix to remove the &apos;where type = $type&apos; part of the query to find existing slugs that might cause a colission with the proposed slug. &lt;/p&gt;

&lt;p&gt;Does anyone have a better idea on how to ask for all slugs in the same model? I had a pretty hard time traversing the inheritance tree to find the right parent class that were not abstract. I see that something similar has been done about soft delete, so that a new record would not get the same slug as a record marked as deleted, but not removed from the databse.&lt;/p&gt;</comment>
                    <comment id="16441" author="klemens_u" created="Tue, 6 Sep 2011 08:52:11 +0000"  >&lt;p&gt;Here&apos;s an improved patch with a better algorithm to find the column aggregation inhertiance base class:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.ullright.org/browser/trunk/plugins/ullCorePlugin/patch/Sluggable.patch?rev=3067&quot; class=&quot;external-link&quot;&gt;http://trac.ullright.org/browser/trunk/plugins/ullCorePlugin/patch/Sluggable.patch?rev=3067&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This fixes my problem (see above)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10426" name="sluggable.patch" size="8915" author="ivarne" created="Thu, 4 Mar 2010 08:37:02 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>