diff --git a/lib/noosfero/api/helpers.rb b/lib/noosfero/api/helpers.rb index 16e0f55..275cc0f 100644 --- a/lib/noosfero/api/helpers.rb +++ b/lib/noosfero/api/helpers.rb @@ -412,7 +412,7 @@ require 'grape' ########################################## def test_captcha(remote_ip, params, environment) - captcha_plugin_enabled = @plugins.dispatch(:test_captcha, remote_ip, params, environment) + captcha_plugin_enabled = @plugins.dispatch(:test_captcha, remote_ip, params, environment).map {|p| p if ! ( p===nil ) } return true if captcha_plugin_enabled.size == 0 if captcha_plugin_enabled.size > 1 return render_api_error!(_("Error processing Captcha"), 500, nil, "More than one captcha plugin enabled") diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index ceb583a..db83f5a 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -671,6 +671,11 @@ class Noosfero::Plugin nil end + #By default will return nil that will mean not implented by the plugin + def test_captcha(*args) + nil + end + # -> Adds additional blocks to profiles and environments. # Your plugin must implements a class method called 'extra_blocks' # that returns a hash with the following syntax. -- libgit2 0.21.2