<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 22:44: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/CODM-28/CODM-28.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>[CODM-28] Adjust to new Annotation Reader</title>
                <link>http://www.doctrine-project.org/jira/browse/CODM-28</link>
                <project id="10050" key="CODM">Doctrine CouchDB ODM</project>
                        <description></description>
                <environment></environment>
            <key id="12749">CODM-28</key>
            <summary>Adjust to new Annotation Reader</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 25 Jun 2011 09:50:24 +0000</created>
                <updated>Wed, 10 Aug 2011 06:50:48 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16305" author="marnusw" created="Wed, 10 Aug 2011 06:50:48 +0000"  >&lt;p&gt;I obtained the latest build from &lt;tt&gt;git://github.com/doctrine/couchdb-odm.git&lt;/tt&gt; so this is an active bug which I believe is related to this issue. &lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;Doctrine\ODM\CouchDB\Mapping\Driver\AnnotationDriver&lt;/tt&gt; produced the exception &lt;cite&gt;Class Test is not a valid document or mapped super class&lt;/cite&gt; for even the most basic document with an Id and one Field. The exception was thrown on line 122 of the above class.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The problem:&lt;/b&gt; &lt;br/&gt;
In the code segment:&lt;br/&gt;
&lt;tt&gt;108: $classAnnotations = $this-&amp;gt;reader-&amp;gt;getClassAnnotations($reflClass);&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;109: if (isset($classAnnotations&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;Doctrine\ODM\CouchDB\Mapping\Document&amp;#39;&amp;#93;&lt;/span&gt;))&lt;/tt&gt;&lt;br/&gt;
the &lt;em&gt;getClassAnnotations&lt;/em&gt; method does not return an array of annotations indexed by annotation names, it uses numeric indexes. This causes the if-statements to always fail and thus the exception is thrown. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;A temporary workaround&lt;/b&gt;:&lt;br/&gt;
&lt;tt&gt;108: $classAnnotations = $this-&amp;gt;reader-&amp;gt;getClassAnnotations($reflClass);&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;Add: $classAnnotations = $classAnnotations&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;109: if ($classAnnotations instanceof \Doctrine\ODM\CouchDB\Mapping\Document) {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;110: $documentAnnot = $classAnnotations;&lt;/tt&gt;&lt;br/&gt;
Rather than checking for the proper index verify the class of the annotation object (Similar to the handling of &lt;em&gt;$fieldAnnot&lt;/em&gt; following this code block). This approach assumes that the &lt;em&gt;@Document&lt;/em&gt; annotation is the first Doctrine related annotation in the class doc block (which is fine, since it is the only one that should be used). Standard annotations such as &lt;em&gt;@author&lt;/em&gt; can precede the &lt;em&gt;@Document&lt;/em&gt; one since these are ignored by the &lt;em&gt;getClassAnnotations&lt;/em&gt; method. The same changes should be applied to all the if statements up to line 120.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>