ref: refs/heads/backgroud_patches_bnc550934
commit 06c2350ee6728033718859ab43d826fe02866c8e
Author: J. Daniel Schmidt
Date: Thu Nov 26 13:35:52 2009 +0100
adding testcase for bnc#557176
---
.../app/controllers/registration_controller.rb | 6 ++--
.../app/views/registration/index.rhtml | 2 +-
.../functional/registration_controller_test.rb | 21 +++++++++++++++++++-
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/plugins/registration/app/controllers/registration_controller.rb b/plugins/registration/app/controllers/registration_controller.rb
index d5979b3..407ef36 100644
--- a/plugins/registration/app/controllers/registration_controller.rb
+++ b/plugins/registration/app/controllers/registration_controller.rb
@@ -36,14 +36,14 @@ class RegistrationController < ApplicationController
def translate_argument_key(key)
return '-unknown-' unless key
- return @trans[key] if @trans[key]
+ return @trans[key] if ( @trans.kind_of?(Hash) && @trans[key] )
key
end
def sort_arguments(args)
- return Array.new unless args
+ return Array.new unless args.kind_of?(Array)
args.collect! do |arg|
- arg['description'] = translate_argument_key( arg['name'] )
+ arg['description'] = translate_argument_key( arg.kind_of?(Hash) ? arg['name'] : nil )
arg
end
args.sort! { |a,b| a['name'] <=> b['name'] }
diff --git a/plugins/registration/app/views/registration/index.rhtml b/plugins/registration/app/views/registration/index.rhtml
index 0f45c63..290b610 100644
--- a/plugins/registration/app/views/registration/index.rhtml
+++ b/plugins/registration/app/views/registration/index.rhtml
@@ -23,7 +23,7 @@
<% if argument["flag"] == "m" || @detail then %>
<p>