? Failure

User tests: Successful: Unsuccessful:

avatar Quy
Quy
27 Dec 2017

Pull Request for Issue #18773.

Summary of Changes

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.

Testing Instructions

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];

Expected result

<div id="dynamic_recaptcha_1" class="g-recaptcha " data-sitekey="SITEKEY_TOKEN" data-theme="light" data-size="compact"></div>

Actual result

<div id="dynamic_recaptcha_1" data-sitekey="SITEKEY_TOKEN" data-theme="light" data-size="compact"></div

Documentation Changes Required

none

avatar Quy Quy - open - 27 Dec 2017
avatar Quy Quy - change - 27 Dec 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Dec 2017
Category Front End Plugins
avatar dennisheiden
dennisheiden - comment - 3 May 2018

@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:

if (empty($class) || $class === 'class=""')
{
	$class = 'class="required"';
}

(I don't know why do we need the "required" css-class here?)

avatar brianteeman
brianteeman - comment - 8 May 2018

restarted drone

avatar Quy Quy - change - 25 Mar 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-03-25 15:49:32
Closed_By Quy
avatar Quy Quy - close - 25 Mar 2019

Add a Comment

Login with GitHub to post a comment