Project

General

Profile

Actions

Defect #34484

open

Error on issue validation

Added by Adriano Bellia about 4 years ago. Updated almost 3 years ago.

Status:
Needs feedback
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When I open a new issue, the data validation (type and required data) works perfectly. If for example I write a character in a numeric field or don't fill a required field I receive the normal red box with the error.
After status changes, if the helpdesk or another assigner writes something wrong or doesn't fill a required field I receive the following error:

Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Below the production.log generated part:

Started PATCH "/issues/1884" for 172.24.112.4 at 2020-12-21 18:20:35 +0100
Processing by IssuesController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"WrsdDIM7eYhFTkjqMBQW2swULoE38w4FOd3Rwmso0DelQJivomeJW8u1yMJ7Mg78MOKkCxxRy39qjqGYKIgF6w==", "form_update_triggered_by"=>"", "issue"=>{"is_private"=>"0", "project_id"=>"15", "author_id"=>"5", "tracker_id"=>"11", "subject"=>"cvbn", "description"=>"dxcvbnmvcxzvhgjfx", "status_id"=>"1", "priority_id"=>"2", "assigned_to_id"=>"", "custom_field_values"=>{"13"=>"Redmine Interno", "17"=>"dcvbn", "18"=>"", "19"=>"", "20"=>"15 giorni - Richiesta ordinaria", "21"=>"", "22"=>"Estratto conto ex art. 50", "23"=>"", "24"=>"2019-11-16", "25"=>"2019-11-16", "26"=>"", "27"=>"2019-11-16", "28"=>"2019-11-16", "30"=>"Tasso Legale", "29"=>"", "31"=>"12345", "32"=>{"blank"=>""}}, "notes"=>"", "private_notes"=>"0", "lock_version"=>"1"}, "was_default_status"=>"1", "last_journal_id"=>"", "commit"=>"Invia", "next_issue_id"=>"557", "issue_position"=>"1", "issue_count"=>"3", "id"=>"1884"}
  Current user: Administrator (id=1)
  Rendering issues/edit.html.erb within layouts/base
  Rendered attachments/_form.html.erb (2.6ms)
  Rendered issues/_form_custom_fields.html.erb (15.3ms)
  Rendered issues/_attributes.html.erb (41.6ms)
  Rendered issues/_form.html.erb (58.2ms)
  Rendered issues/_edit.html.erb (66.3ms)
  Rendered issues/edit.html.erb within layouts/base (68.7ms)
Completed 500 Internal Server Error in 168ms (ActiveRecord: 9.6ms)

ActionView::Template::Error (undefined method `any?' for nil:NilClass):
    40:       </fieldset>
    41:
    42:       <fieldset id="attachments_form" style="<%= "display: none;" unless @issue.attachments_addable?(User.current) %>"><legend><%= l(:label_attachment_plural) %></legend>
    43:         <% if @attachments.any? && @issue.safe_attribute?('deleted_attachment_ids') %>
    44:         <div class="contextual"><%= link_to l(:label_edit_attachments), '#', :onclick => "$('#existing-attachments').toggle(); return false;" %></div>
    45:         <div id="existing-attachments" style="<%= @issue.deleted_attachment_ids.blank? ? 'display:none;' : '' %>">
    46:           <% @attachments.each do |attachment| %>

app/views/issues/_edit.html.erb:43:in `block in _app_views_issues__edit_html_erb__169474526129585408_70197454896560'
app/helpers/application_helper.rb:1242:in `labelled_form_for'
app/views/issues/_edit.html.erb:1:in `_app_views_issues__edit_html_erb__169474526129585408_70197454896560'
app/views/issues/edit.html.erb:3:in `_app_views_issues_edit_html_erb__3897739985162189416_70197464417020'
app/controllers/issues_controller.rb:194:in `block (2 levels) in update'
app/controllers/issues_controller.rb:193:in `update'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Actions #1

Updated by Holger Just almost 4 years ago

  • Description updated (diff)
Actions #2

Updated by Marius BĂLTEANU almost 4 years ago

  • Subject changed from error on issue validation to Error on issue validation
  • Status changed from New to Needs feedback

We really need more info about your environment, please see submissions.

Actions #3

Updated by Go MAEDA almost 3 years ago

Have you modified the source code of Redmine?

The error log indicates that line 43 of app/views/issues/_edit.html.erb is the following.

<% if @attachments.any? && @issue.safe_attribute?('deleted_attachment_ids') %>

But in the original app/views/issues/_edit.html.erb, line 43 is as follows (@attachments.any? should be @issue.attachments.any?).

<% if @issue.attachments.any? && @issue.safe_attribute?('deleted_attachment_ids') %>
Actions

Also available in: Atom PDF