Parent issue is "Replace deprecated lcg_value() function calls".
https://www.drupal.org/project/captcha/issues/3570435
This was marked as Closed, and I cannot reopen, so I am creating a new issue.

The patch/MR has a problem, see below.

Details:
Captcha 2.0.10:
Drupal core 11.3.13
PHP 8.4

1) Tried to install the MR patch, and it failed.

2) I then installed the patch from #2, and am getting this error when the captcha is supposed to be rendered (also on the image_captcha config page):

ParseError: syntax error, unexpected token ".", expecting identifier or variable or "{" or "$" in {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}() (Zeile 131 in /...../www/modules/contrib/captcha/modules/image_captcha/src/Service/ImageCaptchaRenderService.php).

The patch applied like this -- note the '.' in front of "getFloat" , so yes here is a problem:
$wavelength_yr = (2 + 3 * $randomizer->.getFloat(0, 1)) * $font_size;

I then inspected the actual patches, and noticed this:

patch #2 actually has the error in it, note the '.' :
+ $wavelength_yr = (2 + 3 * $randomizer->.getFloat(0, 1)) * $font_size;

In the MR, the line is correct:
+ $wavelength_yr = (2 + 3 * $randomizer->getFloat(0, 1)) * $font_size;

But the MR fails to install for me.

Comments

hoporr created an issue. See original summary.

hoporr’s picture

Issue summary: View changes
hoporr’s picture

Tried to install the MR against 2.0.10 on a second site and it failed again.

avpaderno’s picture

Version: 2.0.10 » 2.x-dev