Use recaptcha plugin and do not define $code for 'onCheckAnswer' event.
Successfully submitted form.
Throws an error:
Warning: Missing argument 1 for PlgCaptchaRecaptcha::onCheckAnswer() in /mysite/plugins/captcha/recaptcha/recaptcha.php on line 114
Joomla 3.4, custom form.
Fix is very simple: remove $code variable from onCheckAnswer() function definition. It's obsolete and never used.
How are you triggering the event? In JCaptcha::checkAnswer() the code variable is defined before calling the plugin event.
Yes, the variable is not used in this plugin, however it appears that the base API expects to use it (perhaps with other captcha providers).
I'm using the standard $dispatcher->trigger('onCheckAnswer', '') line. I understand the backwards compatibility with other captcha plugins, but at least $code variable can be optional:
public function checkAnswer($code = '')
That was my initial point.
Labels |
Added:
?
|
This code is cleaned up in my other PR https://github.com/joomla/joomla-cms/pull/6235/files#L114
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-01 20:20:33 |
Closed_By | ⇒ | zero-24 |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-01 20:20:33 |
Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/6228
Closing as we have a PR by @PhilETaylor #6235
The PR is now clean and ready for testing/merging
As you have identified an issue and a solution please can you submit a Pull Request so that it can be tested and merged.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6228.