Commit 58db89bf181f4d8e6c2e1849f912cd2f7b34ba80

Authored by Evandro Junior
1 parent 5f0ef805

Fix for hotspot plugin

lib/noosfero/api/helpers.rb
@@ -412,7 +412,7 @@ require 'grape' @@ -412,7 +412,7 @@ require 'grape'
412 ########################################## 412 ##########################################
413 413
414 def test_captcha(remote_ip, params, environment) 414 def test_captcha(remote_ip, params, environment)
415 - captcha_plugin_enabled = @plugins.dispatch(:test_captcha, remote_ip, params, environment) 415 + captcha_plugin_enabled = @plugins.dispatch(:test_captcha, remote_ip, params, environment).map {|p| p if ! ( p===nil ) }
416 return true if captcha_plugin_enabled.size == 0 416 return true if captcha_plugin_enabled.size == 0
417 if captcha_plugin_enabled.size > 1 417 if captcha_plugin_enabled.size > 1
418 return render_api_error!(_("Error processing Captcha"), 500, nil, "More than one captcha plugin enabled") 418 return render_api_error!(_("Error processing Captcha"), 500, nil, "More than one captcha plugin enabled")
lib/noosfero/plugin.rb
@@ -671,6 +671,11 @@ class Noosfero::Plugin @@ -671,6 +671,11 @@ class Noosfero::Plugin
671 nil 671 nil
672 end 672 end
673 673
  674 + #By default will return nil that will mean not implented by the plugin
  675 + def test_captcha(*args)
  676 + nil
  677 + end
  678 +
674 # -> Adds additional blocks to profiles and environments. 679 # -> Adds additional blocks to profiles and environments.
675 # Your plugin must implements a class method called 'extra_blocks' 680 # Your plugin must implements a class method called 'extra_blocks'
676 # that returns a hash with the following syntax. 681 # that returns a hash with the following syntax.