User tests: Successful: Unsuccessful:
Pull Request for Issue #18773.
Per the docblock, the $class
parameter expects class="required"
to be passed since a str_replace
will be performed on this parameter. This PR assigns a value to $class
parameter when not set.
Code review
This was provided in the issue, but I did not know how/where to insert it to test.
JPluginHelper::importPlugin('captcha');
$dispatcher = JDispatcher::getInstance();
$arr = $dispatcher->trigger('onInit', 'dynamic_recaptcha_1');
echo $arr[0];
<div id="dynamic_recaptcha_1" class="g-recaptcha " data-sitekey="SITEKEY_TOKEN" data-theme="light" data-size="compact"></div>
<div id="dynamic_recaptcha_1" data-sitekey="SITEKEY_TOKEN" data-theme="light" data-size="compact"></div
none
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
restarted drone
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-25 15:49:32 |
Closed_By | ⇒ | Quy |
@Quy My old testing doesn't make sense to me / can't remember in detail.
But I did some testing with the recaptcha.php. Currently Joomla (3.8.7) calls with $class = 'class=""' the function, so your if clause doesn't trigger.
So, my suggestion is to write it like this:
(I don't know why do we need the "required" css-class here?)