Note that there are some explanatory texts on larger screens.

plurals
  1. POredmine or ruby 500 internal error when creating new project: undefined local variable
    primarykey
    data
    text
    <p>I just installed redmine on ubunutu/nginx/postgres and I get this error when creating a new project... any ideas? (I'm new to ruby so can't really tell what it wants to happen)</p> <pre><code>Started GET "/projects/new" for 50.116.19.7 at Tue Aug 14 08:31:52 +0200 2012 Processing by ProjectsController#new as HTML Rendered projects/_form.html.erb (4.2ms) Rendered projects/new.html.erb within layouts/base (6.0ms) Completed 500 Internal Server Error in 131ms ActionView::Template::Error (undefined local variable or method `self_and_descendants' for #&lt;Project:0xb490ca54&gt;): 4: &lt;!--[form:project]--&gt; 5: &lt;p&gt;&lt;%= f.text_field :name, :required =&gt; true, :size =&gt; 60 %&gt;&lt;/p&gt; 6: 7: &lt;% unless @project.allowed_parents.compact.empty? %&gt; 8: &lt;p&gt;&lt;%= label(:project, :parent_id, l(:field_parent)) %&gt;&lt;%= parent_project_select_tag(@project) %&gt;&lt;/p&gt; 9: &lt;% end %&gt; 10: app/models/project.rb:333:in 'allowed_parents' app/views/projects/_form.html.erb:7:in '_app_views_projects__form_html_erb___577557764__627958918' app/views/projects/new.html.erb:4:in '_app_views_projects_new_html_erb___126828522__630632748' app/helpers/application_helper.rb:950:in `labelled_form_for' app/views/projects/new.html.erb:3:in '_app_views_projects_new_html_erb___126828522__630632748' </code></pre> <p><strong>from redmine/app/models/project.rb (sorry, cant seem to figure out how to propery format code to display here</strong>)</p> <pre><code># Returns an array of projects the project can be moved to # by the current user def allowed_parents return @allowed_parents if @allowed_parents @allowed_parents = Project.find(:all, :conditions =&gt; Project.allowed_to_condition(User.current, :add_subprojects)) @allowed_parents = @allowed_parents - self_and_descendants if User.current.allowed_to?(:add_project, nil, :global =&gt; true) || (!new_record? &amp;&amp; parent.nil?) @allowed_parents &lt;&lt; nil end unless parent.nil? || @allowed_parents.empty? || @allowed_parents.include?(parent) @allowed_parents &lt;&lt; parent end @allowed_parents end # Sets the parent of the project with authorization check def set_allowed_parent!(p) unless p.nil? || p.is_a?(Project) if p.to_s.blank? p = nil else p = Project.find_by_id(p) return false unless p end end if p.nil? if !new_record? &amp;&amp; allowed_parents.empty? return false end elsif !allowed_parents.include?(p) return false 334,5 35% elsif !allowed_parents.include?(p) return false end set_parent!(p) end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload