<?xml version="1.0" encoding="UTF-8"?>
<issue>
  <id>3498</id>
  <project name="Redmine" id="1"/>
  <tracker name="Defect" id="1"/>
  <status name="Resolved" id="3"/>
  <priority name="Normal" id="4"/>
  <author name="Davide Ferrari" id="5588"/>
  <category name="Issues" id="2"/>
  <subject>500 internal error when listing issues from a particular tracker within a project</subject>
  <description>Using r2791

All other trackers in the same project, work.
The same tracker (the default "bug" FYI) in othe rprojects, can list all opened issues without a problem.
But in one project it fails with the following output in production.log

&lt;pre&gt;
ActionView::TemplateError (undefined method `position' for nil:NilClass) on line #25 of app/views/issues/_list.rhtml:
22:             &lt;/td&gt;                                                                                                
23:             &lt;/tr&gt;                                                                                                
24:   &lt;% end %&gt;                                                                                                      
25:     &lt;tr id="issue-&lt;%= issue.id %&gt;" class="hascontextmenu &lt;%= cycle('odd', 'even') %&gt; &lt;%= issue.css_classes %&gt;"&gt;  
26:         &lt;td class="checkbox"&gt;&lt;%= check_box_tag("ids[]", issue.id, false, :id =&gt; nil) %&gt;&lt;/td&gt;                     
27:             &lt;td&gt;&lt;%= link_to issue.id, :controller =&gt; 'issues', :action =&gt; 'show', :id =&gt; issue %&gt;&lt;/td&gt;           
28:         &lt;% query.columns.each do |column| %&gt;&lt;%= content_tag 'td', column_content(column, issue), :class =&gt; column.name %&gt;&lt;% end %&gt;

    app/models/issue.rb:274:in `css_classes'
    app/views/issues/_list.rhtml:25         
    app/views/issues/_list.rhtml:14:in `each'
    app/views/issues/_list.rhtml:14          
    /var/lib/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/capture_helper.rb:36:in `call'
    /var/lib/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/capture_helper.rb:36:in `capture'
    /var/lib/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
    /var/lib/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/capture_helper.rb:36:in `capture'            
    /var/lib/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/form_tag_helper.rb:460:in `form_tag_in_block'
    /var/lib/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/form_tag_helper.rb:39:in `form_tag'         
&lt;/pre&gt;</description>
  <start_date>2009-06-15</start_date>
  <due_date></due_date>
  <done_ratio>0</done_ratio>
  <estimated_hours></estimated_hours>
  <custom_fields>
    <custom_field name="Affected version" id="1">devel</custom_field>
    <custom_field name="Resolution" id="2"></custom_field>
  </custom_fields>
  <created_on>Mon Jun 15 12:48:55 +0200 2009</created_on>
  <updated_on>Wed Jun 17 10:23:50 +0200 2009</updated_on>
  <journals>
    <journal id="9781">
      <user name="Jean-Philippe Lang" id="1"/>
      <notes>One of your issue is associated to a status or a priority that no longer exists.
That's why you get this error.

Did you manually remove one of them from your database?</notes>
      <details>
      </details>
    </journal>
    <journal id="9789">
      <user name="Davide Ferrari" id="5588"/>
      <notes>Jean-Philippe Lang wrote:
&gt; One of your issue is associated to a status or a priority that no longer exists.
&gt; That's why you get this error.

Yeah, that was I suspected too

&gt; Did you manually remove one of them from your database?

No, absolutely. I didn't touch anything manually, just gone through updates (from 0.8.4 to trunk, the updated to another revision, then boom!). What can I do to solve the problem?
</notes>
      <details>
      </details>
    </journal>
    <journal id="9806">
      <user name="Davide Ferrari" id="5588"/>
      <notes>Indeed it was a priority that doesn't exist anymore. We manually updated the priority for the bug causing the error and now it works. I wonder how this could have happened anyway, because I can assure we didn't touch the DB manually, so if we deleted a priority (and it could be) we did it through Redmine interface</notes>
      <details>
        <detail old="1" name="status_id" property="attr" new="3"/>
      </details>
    </journal>
  </journals>
</issue>
