Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!5127
Issue
#3396742
: CKEditor5 doens't save updated value if form submitted right after the change
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3396742
: CKEditor5 doens't save updated value if form submitted right after the change
issue/drupal-3396742:3396742-ckeditor5-doenst-save
into
11.x
Overview
2
Commits
3
Pipelines
10
Changes
2
1 unresolved thread
Hide all comments
Open
Misha Lavrenchuk
requested to merge
issue/drupal-3396742:3396742-ckeditor5-doenst-save
into
11.x
1 year ago
Overview
2
Commits
3
Pipelines
10
Changes
1
1 unresolved thread
Hide all comments
Expand
Closes
#3396742
0
0
Merge request reports
Compare
11.x
version 7
9e973e74
1 year ago
version 6
402abf2f
1 year ago
version 5
01cdd1fe
1 year ago
version 4
66a5bbec
1 year ago
version 3
9765390d
1 year ago
version 2
1b423fab
1 year ago
version 1
4a0ed8bd
1 year ago
11.x (HEAD)
and
latest version
latest version
125a3ec2
3 commits,
1 year ago
version 7
9e973e74
3 commits,
1 year ago
version 6
402abf2f
3 commits,
1 year ago
version 5
01cdd1fe
2 commits,
1 year ago
version 4
66a5bbec
2 commits,
1 year ago
version 3
9765390d
1 commit,
1 year ago
version 2
1b423fab
1 commit,
1 year ago
version 1
4a0ed8bd
1 commit,
1 year ago
1 file
+
78
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php
+
78
−
0
Options
@@ -726,4 +726,82 @@ function (ConstraintViolationInterface $v) {
$this
->
assertSession
()
->
responseContains
(
'Text hidden in the source'
);
}
/**
* Ensures that changes are saved in CKEditor 5.
*/
public
function
testSave
():
void
{
// To replicate the bug from https://www.drupal.org/i/3396742
// We need 2 or more text formats and node edit page.
FilterFormat
::
create
([
'format'
=>
'ckeditor5'
,
'name'
=>
'CKEditor 5 HTML'
,
'roles'
=>
[
RoleInterface
::
AUTHENTICATED_ID
],
])
->
save
();
Editor
::
create
([
'format'
=>
'ckeditor5'
,
'editor'
=>
'ckeditor5'
,
'settings'
=>
[
'toolbar'
=>
[
'items'
=>
[
'sourceEditing'
,
],
],
'plugins'
=>
[
'ckeditor5_sourceEditing'
=>
[
'allowed_tags'
=>
[],
],
],
],
])
->
save
();
$this
->
assertSame
([],
array_map
(
function
(
ConstraintViolation
$v
)
{
return
(
string
)
$v
->
getMessage
();
},
iterator_to_array
(
CKEditor5
::
validatePair
(
Editor
::
load
(
'ckeditor5'
),
FilterFormat
::
load
(
'ckeditor5'
)
))
));
FilterFormat
::
create
([
'format'
=>
'ckeditor5_2'
,
'name'
=>
'CKEditor 5 HTML 2'
,
'roles'
=>
[
RoleInterface
::
AUTHENTICATED_ID
],
])
->
save
();
Editor
::
create
([
'format'
=>
'ckeditor5_2'
,
'editor'
=>
'ckeditor5'
,
])
->
save
();
$this
->
assertSame
([],
array_map
(
function
(
ConstraintViolation
$v
)
{
return
(
string
)
$v
->
getMessage
();
},
iterator_to_array
(
CKEditor5
::
validatePair
(
Editor
::
load
(
'ckeditor5_2'
),
FilterFormat
::
load
(
'ckeditor5_2'
)
))
));
$this
->
drupalCreateNode
([
'title'
=>
'My test content'
,
]);
// Test that entered text is saved.
$this
->
drupalGet
(
'node/1/edit'
);
$page
=
$this
->
getSession
()
->
getPage
();
$this
->
waitForEditor
();
$editor
=
$page
->
find
(
'css'
,
'.ck-content'
);
$editor
->
setValue
(
'Very important information'
);
$page
->
pressButton
(
'Save'
);
$this
->
assertSession
()
->
responseContains
(
'Very important information'
);
// Test that changes only in source are saved.
$this
->
drupalGet
(
'node/1/edit'
);
$page
=
$this
->
getSession
()
->
getPage
();
$this
->
waitForEditor
();
$this
->
pressEditorButton
(
'Source'
);
$editor
=
$page
->
find
(
'css'
,
'.ck-source-editing-area textarea'
);
$editor
->
setValue
(
'Text hidden in the source'
);
$page
->
pressButton
(
'Save'
);
$this
->
assertSession
()
->
responseContains
(
'Text hidden in the source'
);
}
}
Loading