Problem/Motivation
Editor Security (Drupal\Tests\editor\Functional\EditorSecurity)
✔ Initial security
✔ Switching security
✘ Editor xss filter override
┐
├ Behat\Mink\Exception\ExpectationException: The field "edit-body-0-value" value is "Hello, Dumbo Octopus!alert(0)", but "Hello, Dumbo Octopus!alert(0)" expected.
│
│ /builds/issue/drupal-3069442/vendor/behat/mink/src/WebAssert.php:888
│ /builds/issue/drupal-3069442/vendor/behat/mink/src/WebAssert.php:781
│ /builds/issue/drupal-3069442/core/tests/Drupal/Tests/WebAssert.php:991
│ /builds/issue/drupal-3069442/core/modules/editor/tests/src/Functional/EditorSecurityTest.php:454
┴
FAILURES!
Tests: 3, Assertions: 131, Failures: 1.
Steps to reproduce
Example: https://git.drupalcode.org/issue/drupal-3069442/-/jobs/3468066#L1429
Proposed resolution
Replace calls to State with calls to KeyValue.
The root cause of this issue is discussed in #3496257: Race conditions in CacheCollector/State (again)
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #5
spokjeMR !10728 (which is basically
\Drupal\Tests\editor\Functional\EditorSecurityTest::testEditorXssFilterOverrideand some pipeline changes to make it, and only it, run 7500 times) gives us 325 fails out of the 10000runs.MR !10729 shows that changing \Drupal::state()->set()/get() to Drupal::keyValue()->set()/get(); passes a 10000 times run without errors.
MR !10731 contains the changes we want committed after review.
Comment #6
smustgrave commentedReviewed MR 10731 and update to keyValue makes sense
Awesome!
Comment #8
catchCommitted/pushed to 11.x and cherry-picked to 11.1.x, thanks!
Looks like this needs a backport for 11.0.x/10.5.x.
Comment #14
spokjeLooks like HEAD broken on 11.0.x: https://www.drupal.org/project/drupal/issues/3490710#comment-15922094, so we're stalled here.
Comment #15
spokjeHEAD fixed, MR for 11.0.x is up
Comment #20
catchCommitted/pushed to 10.5.x/10.4.x/11.0.x/10.3.x, thanks!
Comment #22
wim leers🤯
As a fellow maintainer of the
editormodule, I reviewed this commit. And I don't understand what the change is about. I'll follow that issue then 😳