プロジェクト

全般

プロフィール

Vote #80562

未完了

ActionView::Template::Error (undefined method `position' for nil:NilClass):

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Documents_4
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
4
version_id:
0
issue_org_id:
32704
author_id:
435605
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
114
ステータス-->[New]

説明

Started GET "/redmine/projects/chinastockreceiver/documents" for 127.0.0.1 at 2019-12-27 20:12:30 +0800
Processing by DocumentsController#index as HTML
Parameters: {"project_id"=>"chinastockreceiver"}
Current user: xuxf (id=17)
Rendered attachments/_form.html.erb (15.7ms)
Rendered documents/_form.html.erb (31.3ms)
Rendered documents/index.html.erb within layouts/base (31.3ms)
Completed 500 Internal Server Error in 78.3ms

ActionView::Template::Error (undefined method position' for nil:NilClass):
18:
19: <% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
20:
21: <% @grouped.keys.sort.each do |group| %>
22: <h3><%= group %></h3>
23: <%= render :partial => 'documents/document', :collection => @grouped[group] %>
24: <% end %>
app/models/enumeration.rb:93:in
<=>'
app/views/documents/index.html.erb:21:in sort'
app/views/documents/index.html.erb:21:in
app_views_documents_index_html_erb_107423285_27756576'


journals

I am not sure why nil is passed to @<=>@, but I think the following patch should fix the problem.

<pre><code class="diff">
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index 4710fde81..a8ca08726 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -90,6 +90,7 @@ class Enumeration < ActiveRecord::Base
end

def <=>(enumeration)
+ return -1 if enumeration.nil?
position <=> enumeration.position
end

</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,10053,undefined method `<=>' for nil:NilClass when accessing the settings of a project

Admin Redmine さんが約2年前に更新

  • カテゴリDocuments_4 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0