Actions
Defect #25337
closedRedmine patch for Rails breaks functionality of select_tag
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
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=""> </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>
- 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
Updated by Go MAEDA over 1 year ago
- Related to Defect #15191: HTML 5 validation failures added
Updated by Go MAEDA 10 months ago
- Related to Patch #40210: Remove overrides that inserts a non-breaking space (nbsp) to empty option elements added
Actions