[DRE-commits] r4533 - trunk/redmine/debian/patches

Jérémy Lal kapouer-guest at alioth.debian.org
Sat Jan 16 16:46:03 UTC 2010


Author: kapouer-guest
Date: 2010-01-16 16:46:03 +0000 (Sat, 16 Jan 2010)
New Revision: 4533

Added:
   trunk/redmine/debian/patches/0013-Duplicate-name-value-in-request.patch
Modified:
   trunk/redmine/debian/patches/series
Log:
Rails 2.2 : considers only the first of inputs with the same name.

Added: trunk/redmine/debian/patches/0013-Duplicate-name-value-in-request.patch
===================================================================
--- trunk/redmine/debian/patches/0013-Duplicate-name-value-in-request.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0013-Duplicate-name-value-in-request.patch	2010-01-16 16:46:03 UTC (rev 4533)
@@ -0,0 +1,42 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 16 Jan 2010 17:16:40 +0100
+Subject: [PATCH] Duplicate name value in request
+
+In rails 2.2, when two inputs have the same name, only the first one's value will be considered. It's best if the hidden input is rejected after the main input, and ignored by rails 2.2.
+---
+ app/helpers/settings_helper.rb |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
+index e57b75f..a5d8355 100644
+--- a/app/helpers/settings_helper.rb
++++ b/app/helpers/settings_helper.rb
+@@ -41,14 +41,14 @@ module SettingsHelper
+     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
++      end.join +
++      hidden_field_tag("settings[#{setting}][]", '')
+   end
+   
+   def setting_text_field(setting, options={})
+@@ -63,8 +63,8 @@ module SettingsHelper
+   
+   def setting_check_box(setting, options={})
+     setting_label(setting, options) +
+-      hidden_field_tag("settings[#{setting}]", 0) +
+-      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
++      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options) +
++      hidden_field_tag("settings[#{setting}]", 0)
+   end
+   
+   def setting_label(setting, options={})
+-- 

Modified: trunk/redmine/debian/patches/series
===================================================================
--- trunk/redmine/debian/patches/series	2010-01-16 16:45:58 UTC (rev 4532)
+++ trunk/redmine/debian/patches/series	2010-01-16 16:46:03 UTC (rev 4533)
@@ -10,3 +10,4 @@
 0010-Wrong-path-for-interpreter.patch
 0011-Allows-environment-variables-to-setup-debian-paths.patch
 0012-Move-session-configuration-to-YML-file-next-to-datab.patch
+0013-Duplicate-name-value-in-request.patch




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