Defect #11027

Saving new query without name causes escaping of input field

Added by Michal Ciasnocha over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:2.0.1
Resolution:Fixed Affected version:2.0.0

Description

During saving new query without filled name is displayed validation error and name input field disappeares and is replaced by text:

<input id="query_name" name="query[name]" size="80" type="text" value="" />

After clicking on Save button the Firebug says "select is null" in file /javascripts/select_list_move.js on line 78.

My configuration:

  • Ruby - 1.8.7
  • Rails - 3.2.3

See attachment for details.

redmine-bug.PNG (26.2 KB) Michal Ciasnocha, 2012-05-25 16:00

Associated revisions

Revision 9711
Added by Jean-Philippe Lang over 5 years ago

Fixed that some input fields are escaped on validation failures (#11027).

History

#1 Updated by Etienne Massip over 5 years ago

  • Category set to Issues
  • Status changed from New to Confirmed
  • Target version set to 2.0.1

#2 Updated by Etienne Massip over 5 years ago

The following patch solves this issue:

### Eclipse Workspace Patch 1.0
#P redmine
Index: config/initializers/10-patches.rb
===================================================================
--- config/initializers/10-patches.rb    (revision 9707)
+++ config/initializers/10-patches.rb    (working copy)
@@ -43,7 +43,7 @@
   end
 end

-ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
+ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| html_tag || '' }

 require 'mail'

#3 Updated by Jean-Philippe Lang over 5 years ago

  • Subject changed from Saving new query without name causes disappearance of input field to Saving new query without name causes escaping of input field
  • Status changed from Confirmed to Resolved
  • Resolution set to Fixed

Fixed in r9711. Etienne, thanks for digging into this.

#4 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF