- Issue created by @andypost
- π«π·France andypost
- π«π·France andypost
Also it reproducible with
drush ev 'echo text_summary("<", NULL, 1)."\n";'
- π«π·France andypost
Manual testing could use following
core$ docker run --rm -it -v $(pwd):/mnt -w /mnt drupalci/php-8.3-apache:production bash Unable to find image 'drupalci/php-8.3-apache:production' locally production: Pulling from drupalci/php-8.3-apache de4cac68b616: Pull complete 6c3a7f5fe02f: Pull complete Digest: sha256:75ee68a6e98792a130eabb1dbd6cfa3dcd8b52fdc4feca5b2b5cd9bdc5b888ea Status: Downloaded newer image for drupalci/php-8.3-apache:production root@5c765fed0c54:/mnt# SIMPLETEST_DB=sqlite://./tests.db SIMPLETEST_BASE_URL=http://localhost php vendor/bin/phpunit -c core/phpunit.xml.dist core/modules/text/tests/src/Kernel/TextSummaryTest.php PHPUnit 9.6.8 by Sebastian Bergmann and contributors. Testing Drupal\Tests\text\Kernel\TextSummaryTest ..F... 6 / 6 (100%) Time: 00:05.817, Memory: 4.00 MB There was 1 failure: 1) Drupal\Tests\text\Kernel\TextSummaryTest::testLength <pre style="white-space: pre-wrap">&lt;</pre> is identical to <pre style="white-space: pre-wrap"></pre> Failed asserting that two strings are identical. ....
- π«π·France andypost
Narrowed down failure to
php -r 'require __DIR__ . "/autoload.php"; echo \Drupal\Component\Utility\Html::normalize("<");'
It returning different results depending on
libxml
version - π«π·France andypost
Running following script exposed the error -
<body><</body>
the warning (raised on older
libxml
version) isPHP Warning: DOMDocument::loadHTML(): htmlParseStartTag: invalid element name in Entity, line: 4 in /mnt/libxml.php on line 10
the script
$document = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head> <body><</body> </html> EOD; $dom = new \DOMDocument(); $dom->loadHTML($document, LIBXML_NOBLANKS); echo $dom->textContent . PHP_EOL;
- π«π·France andypost
PHP maintainers said to file issue to https://gitlab.gnome.org/GNOME/libxml2/-/issues
- π¬π§United Kingdom longwave UK
I believe π Upgrade filter system to HTML5 Fixed should make this result consistent on all environments.
- @andypost opened merge request.
- Status changed to Needs work
about 1 year ago 4:46pm 3 October 2023 - π«π·France andypost
Filed MR to test on PHP 8.3 both html5 and assert_options patches https://git.drupalcode.org/project/drupal/-/merge_requests/4925
- Status changed to Postponed
about 1 year ago 5:16pm 3 October 2023 - π«π·France andypost
As the test passing after π Upgrade filter system to HTML5 Fixed
postponing on it
- π«π·France andypost
Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest::testFieldUiIntegration Behat\Mink\Exception\ExpectationException: Checkbox "set_default_value" is not checked, but it should be.
re-queued
- Status changed to Closed: outdated
about 1 year ago 11:18am 4 October 2023 - πΈπ°Slovakia poker10
Just fyi, this is still relevant for D7, where we cannot change the
DOMDocument
easily. D7 issue is here: π [D7 PHP 8.3] TextSummaryTestCase::testLength() fails on some libxml versions ActiveHave you found any workarounds or created a bug report in the libxml2 issue queue (https://gitlab.gnome.org/GNOME/libxml2/-/issues)? Thanks!
- π«π·France andypost
created a bug report in the libxml2 issue queue
personally I prefer to go this way
- π¨π¦Canada joseph.olstad
There's been 15 releases of libxml2 since 2.9.14
any chance that this issue is fixed in https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.3 v2.12.3?