[DRE-maint] Bug#705533: a Solution to this bug

Guillaume Pancak guillaume at pancak.com
Sun Apr 28 11:24:37 UTC 2013


Hi all,

i thing the bug can be resolved with a simple patch to /usr/share/redmine/app/helpers/settings_helper.rb,:

def setting_multiselect(setting, choices, options={})
    setting_values = Setting.send(setting)
    setting_values = [] unless setting_values.is_a?(Array)

    setting_label(setting, options) +
      hidden_field_tag("settings[#{setting}][]", '') +
      choices.collect do |choice|
        text, value = (choice.is_a?(Array) ? choice : [choice, choice])
        content_tag('label',
          check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
          :class => 'block'
        )
      end.join

Replace the last line end.join by end.reduce(:<<)  :

the setting_multiselect function become :

def setting_multiselect(setting, choices, options={})
    setting_values = Setting.send(setting)
    setting_values = [] unless setting_values.is_a?(Array)

    setting_label(setting, options) +
      hidden_field_tag("settings[#{setting}][]", '') +
      choices.collect do |choice|
        text, value = (choice.is_a?(Array) ? choice : [choice, choice])
        content_tag('label',
          check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
          :class => 'block'
        )
      end.reduce(:<<) 

il you think this is acceptable solution, is the package maintainer can make a patch and a new package ?

Thans

PS: Sorry for my poor english. ;)

Guillaume Pancak
guillaume at pancak.com





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20130428/4792b78a/attachment-0001.html>


More information about the Pkg-ruby-extras-maintainers mailing list