ref: refs/heads/master
commit a8a11b400dc516b86148385f3340c54e1b6b3a06
Author: J. Daniel Schmidt
Date: Mon Oct 26 19:08:06 2009 +0100
fixing registration error, hash is nil
---
plugins/registration/app/models/register.rb | 4 ++--
webyast-beta3-registration.diff | 15 +++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/plugins/registration/app/models/register.rb b/plugins/registration/app/models/register.rb
index 94ebf1f..448a8f8 100644
--- a/plugins/registration/app/models/register.rb
+++ b/plugins/registration/app/models/register.rb
@@ -80,8 +80,8 @@ class Register
ctx = Hash.new
args = Hash.new
begin
- self.context.each { |k, v| ctx[k.to_s] = [ 's', v.to_s ] }
- self.arguments.each { |k, v| args[k.to_s] = [ 's', v.to_s ] }
+ self.context.each { |k, v| ctx[k.to_s] = [ 's', v.to_s ] } if self.context.class == Hash
+ self.arguments.each { |k, v| args[k.to_s] = [ 's', v.to_s ] } if self.arguments.class == Hash
rescue
Rails.logger.error "When registration was called, the context or the arguments data was invalid."
raise InvalidParameters.new :registrationdata => "Invalid"
diff --git a/webyast-beta3-registration.diff b/webyast-beta3-registration.diff
new file mode 100644
index 0000000..4d78acf
--- /dev/null
+++ b/webyast-beta3-registration.diff
@@ -0,0 +1,15 @@
+diff --git a/plugins/registration/app/models/register.rb b/plugins/registration/app/models/register.rb
+index 94ebf1f..448a8f8 100644
+--- a/plugins/registration/app/models/register.rb
++++ b/plugins/registration/app/models/register.rb
+@@ -80,8 +80,8 @@ class Register
+ ctx = Hash.new
+ args = Hash.new
+ begin
+- self.context.each { |k, v| ctx[k.to_s] = [ 's', v.to_s ] }
+- self.arguments.each { |k, v| args[k.to_s] = [ 's', v.to_s ] }
++ self.context.each { |k, v| ctx[k.to_s] = [ 's', v.to_s ] } if self.context.class == Hash
++ self.arguments.each { |k, v| args[k.to_s] = [ 's', v.to_s ] } if self.arguments.class == Hash
+ rescue
+ Rails.logger.error "When registration was called, the context or the arguments data was invalid."
+ raise InvalidParameters.new :registrationdata => "Invalid"
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org