Problem/Motivation
Faced in #3375693-27: Fix deprecated assert_options() function usage for PHP 8.3
Running test on debian:buster and newer releases the test fails, faced on PHP 8.3 image as it was updated to the latest debian:bookworm
PHP 8.2 image using libxml libXML Compiled Version => 2.9.10 but 8.3 using 2.9.14
- 8.2 https://dispatcher.drupalci.org/job/drupal_patches/199724/artifact/jenki...
- 8.3 https://dispatcher.drupalci.org/job/drupal_patches/199725/artifact/jenki...
Locally on Ubuntu 23.04 using PHP 8.1 with libxml 2.9.14 the test case also fails, also tested on Alpinelinux 2.11.5 where it also fails independently from PHP version
Previously similar issues with libxml version #3280602-13: Exceptions for CKEditor 5 plugin definitions containing wildcard tags when PHP is built with libxml 2.9.14 @mstrelan suggested
Steps to reproduce
# using 8.2 CI image
core$ docker run --rm -it -v $(pwd):/mnt -w /mnt drupalci/php-8.2-apache:production bash
root@c17f9a60c448:/mnt# php -r 'require __DIR__ . "/autoload.php"; echo \Drupal\Component\Utility\Html::normalize("<");'
# no result rendered
# upgrade libxml2 using https://packages.sury.org/php/README.txt
root@c17f9a60c448:/mnt# curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
root@c17f9a60c448:/mnt# sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list'
# apt update && apt list --upgradable
# apt upgrade -y
root@c17f9a60c448:/mnt# php -r 'require __DIR__ . "/autoload.php"; echo \Drupal\Component\Utility\Html::normalize("<");'
<
All newer libxml returns <
Proposed resolution
- find out
Remaining tasks
- find the cause
- patch/review/commit
User interface changes
no
API changes
no
Data model changes
no
Release notes snippet
Issue fork drupal-3383577
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3383577-text-summary-test-8.3
changes, plain diff MR !4925
Comments
Comment #2
andypostadded a bit more to IS
Comment #3
andypostSimilar problems were found in #3280602-13: Exceptions for CKEditor 5 plugin definitions containing wildcard tags when PHP is built with libxml 2.9.14
Comment #4
andypostComment #5
andypostComment #6
andypostComment #7
andypostupdated steps to reproduce
Comment #8
andypostComment #10
andypostComment #11
andypostAlso it reproducible with
drush ev 'echo text_summary("<", NULL, 1)."\n";'Comment #12
andypostManual testing could use following
Comment #13
andypostNarrowed down failure to
It returning different results depending on
libxmlversionDetails edited
The resulting DOM object from
\Drupal\Component\Utility\Html::load()is differentnew versions (PHP 8.3) returns
Comment #14
andypostComment #15
andypostRunning following script exposed the error -
<body><</body>the warning (raised on older
libxmlversion) isthe script https://3v4l.org/bBP3r
https://github.com/php/php-src/issues/11469#issuecomment-1699885043
Comment #16
andypostPHP maintainers said to file issue to https://gitlab.gnome.org/GNOME/libxml2/-/issues
Comment #17
longwaveI believe #2441811: Upgrade filter system to HTML5 should make this result consistent on all environments.
Comment #19
andypostFiled MR to test on PHP 8.3 both html5 and assert_options patches https://git.drupalcode.org/project/drupal/-/merge_requests/4925
Comment #20
andypostAs the test passing after #2441811: Upgrade filter system to HTML5
postponing on it
Comment #21
andypostre-queued and it was random failure
Comment #22
andypostComment #23
andypostAs #2441811: Upgrade filter system to HTML5
Comment #25
poker10 commentedJust fyi, this is still relevant for D7, where we cannot change the
DOMDocumenteasily. D7 issue is here: #3397882: [D7 PHP 8.3] TextSummaryTestCase::testLength() fails on some libxml versionsHave you found any workarounds or created a bug report in the libxml2 issue queue (https://gitlab.gnome.org/GNOME/libxml2/-/issues)? Thanks!
Comment #26
andypostpersonally I prefer to go this way
Comment #27
joseph.olstadThere'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?