Project

General

Profile

Actions

Defect #25337

closed

Redmine patch for Rails breaks functionality of select_tag

Added by Stephan Wiehr about 7 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Rails support
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The Redmine patch in config/initializers/10-patches.rb breaks the functionality of ActionView::Helpers::FormTagHelper::select_tag, which states in the Rails documentation:

:include_blank - If set to true, an empty option will be created. If set to a string, the string will be used as the option’s content and the value will be empty.
[...]
select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All" 
# => <select id="people" name="people"><option value="">All</option><option value="1">David</option></select>

With the patch a string value given for :include_blank is not taken into account for the resulting option which will be &nbsp; unless the option :prompt is given.
This means the above example will result in

select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All" 
# => <select id="people" name="people"><option value="">&nbsp;</option><option value="1">David</option></select>

PS: I did not check but this is possibly similar for the other patches trying to correct the invalid <option value=""></option>

My Redmine environment:
  • Redmine version 3.3.2.stable.16377
  • Ruby version 2.3.1-p112 (2016-04-26) [x86_64-linux-gnu]
  • Rails version 4.2.7.1
  • Environment production
  • Database adapter Mysql2

Related issues

Related to Redmine - Defect #15191: HTML 5 validation failuresClosedJean-Philippe Lang

Actions
Related to Redmine - Patch #40210: Remove overrides that inserts a non-breaking space (nbsp) to empty option elementsClosedMarius BĂLTEANU

Actions
Actions #1

Updated by Go MAEDA about 1 year ago

Actions #2

Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed
  • Resolution set to Fixed

The patch was removed in r22701.

Actions #3

Updated by Go MAEDA 2 months ago

  • Related to Patch #40210: Remove overrides that inserts a non-breaking space (nbsp) to empty option elements added
Actions

Also available in: Atom PDF