here's the patch version of the fork change above, tested and working.
This patch is for 'drupal/address:1.9' (last D8 module) and the resulting Composer dependency "commerceguys/addressing":"v1.4.x", tested and working.
I agree with dratta that the 3302484-28-for-8.x-1.9.patch
in #28 does not work, at least not with 'drupal/address:1.9' and the resulting "commerceguys/addressing":"v1.4.2" (resulting from the module's composer.json
's requirement of "commerceguys/addressing": "^1.0.7"
.
This is a reroll to backport PHP 8.1 trim null fix β
Confirmed `$form_state` is not used in `blockreference_autocomplete_value()`, and new patch removes use.
We're facing this same issue. I've narrowed it down to this code $fix = $phpcsFile->addFixableError($error, ($i + 1), 'BlankLinesFound');
returns TRUE, which makes the following conditional TRUE, so then the final line $phpcsFile->fixer->replaceToken(($i + 1), '');
replaces the brace with empty string. Unfortunately I'm not following the overall logic to know what's the real issue is.
I've included screenshots of xdebug vars, so one should be able to make out what's happening here.
// We changed lines.
if ($foundContent === false) {
// Before we throw an error, make sure we are not looking
// at a gap before the style definition.
$prev = $phpcsFile->findPrevious(T_WHITESPACE, $i, null, true);
if ($prev !== false
&& isset($endTokens[$tokens[$prev]['code']]) === false
) {
$error = 'Blank lines are not allowed between class names';
$fix = $phpcsFile->addFixableError($error, ($i + 1), 'BlankLinesFound');
if ($fix === true) {
$phpcsFile->fixer->replaceToken(($i + 1), '');
}
}
break;
}
I didn't see this fix in the last patch, but the error is in the phpcs output in the original post. The same error arrises from what's we're running (to confirm PHP8.1 compatibility) phpcs --runtime-set testVersion 8.1- --standard=PHPCompatibility
.
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------
88 | ERROR | The behaviour of hexadecimal numeric strings was inconsistent prior to PHP 7 and support has been removed in PHP 7. Found: '0x0'
-----------------------------------------------------------------------------------------------------------------------------------------------
I had to use patch -p1
to apply this to 7.x-1.9 as git apply
failed, even though the line numbers match.
There is a newer issue on this, with the same fix https://www.drupal.org/project/facetapi/issues/3352819 π PHP 8.1: deprecated function warnings due to missing return type Closed: duplicate
Todd Zebert β created an issue.