Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embed
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
embed
Merge requests
!2
Issue
#3309747
: Support CKEditor4 and CKEditor5
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Issue
#3309747
: Support CKEditor4 and CKEditor5
issue/embed-3309747:3309747-ckeditor5-compatibility
into
8.x-1.x
Overview
8
Commits
24
Pipelines
4
Changes
9
Merged
Issue #3309747: Support CKEditor4 and CKEditor5
Balint Pekker
requested to merge
issue/embed-3309747:3309747-ckeditor5-compatibility
into
8.x-1.x
Sep 19, 2022
Overview
4
Commits
24
Pipelines
4
Changes
9
Closes
#3309747
1
0
Merge request reports
Compare
8.x-1.x
version 23
48ac799a
Oct 18, 2023
version 22
c5a6e808
Oct 18, 2023
version 21
b0e71098
Oct 18, 2023
version 20
be620ab9
Oct 18, 2023
version 19
32131944
Oct 17, 2023
version 18
e4a16215
Jun 20, 2023
version 17
c69445bb
Jun 8, 2023
version 16
ed37bca0
Jun 8, 2023
version 15
fdd35543
Jun 7, 2023
version 14
d0d34918
Jun 7, 2023
version 13
ba712d44
Jun 7, 2023
version 12
e6e0c44e
Jun 7, 2023
version 11
a9fd3341
Jun 7, 2023
version 10
0bec9ef7
Jun 7, 2023
version 9
8e5ae6c9
Jun 7, 2023
version 8
c97c5f6f
Jun 7, 2023
version 7
6d636291
May 4, 2023
version 6
f5be4cb2
May 4, 2023
version 5
aff2aa50
May 4, 2023
version 4
bce0441f
May 4, 2023
version 3
fa392235
May 4, 2023
version 2
1dfb8ace
Jan 30, 2023
version 1
d43a403b
Sep 19, 2022
8.x-1.x (base)
and
latest version
latest version
48ac799a
24 commits,
Oct 18, 2023
version 23
48ac799a
24 commits,
Oct 18, 2023
version 22
c5a6e808
23 commits,
Oct 18, 2023
version 21
b0e71098
22 commits,
Oct 18, 2023
version 20
be620ab9
21 commits,
Oct 18, 2023
version 19
32131944
20 commits,
Oct 17, 2023
version 18
e4a16215
19 commits,
Jun 20, 2023
version 17
c69445bb
18 commits,
Jun 8, 2023
version 16
ed37bca0
17 commits,
Jun 8, 2023
version 15
fdd35543
15 commits,
Jun 7, 2023
version 14
d0d34918
13 commits,
Jun 7, 2023
version 13
ba712d44
12 commits,
Jun 7, 2023
version 12
e6e0c44e
11 commits,
Jun 7, 2023
version 11
a9fd3341
10 commits,
Jun 7, 2023
version 10
0bec9ef7
9 commits,
Jun 7, 2023
version 9
8e5ae6c9
8 commits,
Jun 7, 2023
version 8
c97c5f6f
7 commits,
Jun 7, 2023
version 7
6d636291
6 commits,
May 4, 2023
version 6
f5be4cb2
5 commits,
May 4, 2023
version 5
aff2aa50
4 commits,
May 4, 2023
version 4
bce0441f
3 commits,
May 4, 2023
version 3
fa392235
3 commits,
May 4, 2023
version 2
1dfb8ace
2 commits,
Jan 30, 2023
version 1
d43a403b
1 commit,
Sep 19, 2022
9 files
+
335
−
39
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
src/Access/EmbedButtonEditorAccessCheck.php
+
15
−
6
View file @ 48ac799a
Edit in single-file editor
Open in Web IDE
Show full file
@@ -78,20 +78,29 @@ class EmbedButtonEditorAccessCheck implements AccessInterface {
* currently only capable of detecting buttons used by CKEditor.
*/
protected
function
checkButtonEditorAccess
(
EmbedButtonInterface
$embed_button
,
EditorInterface
$editor
)
{
if
(
$editor
->
getEditor
()
!==
'ckeditor'
)
{
if
(
!
in_array
(
$editor
->
getEditor
()
,
[
'ckeditor'
,
'ckeditor5'
],
TRUE
)
)
{
throw
new
HttpException
(
500
,
'Currently, only CKEditor is supported.'
);
}
$has_button
=
FALSE
;
$settings
=
$editor
->
getSettings
();
foreach
(
$settings
[
'toolbar'
][
'rows'
]
as
$row
)
{
foreach
(
$row
as
$group
)
{
if
(
in_array
(
$embed_button
->
id
(),
$group
[
'items'
]))
{
$has_button
=
TRUE
;
break
2
;
if
(
$editor
->
getEditor
()
===
'ckeditor'
)
{
foreach
(
$settings
[
'toolbar'
][
'rows'
]
as
$row
)
{
foreach
(
$row
as
$group
)
{
if
(
in_array
(
$embed_button
->
id
(),
$group
[
'items'
]))
{
$has_button
=
TRUE
;
break
2
;
}
}
}
}
elseif
(
$editor
->
getEditor
()
===
'ckeditor5'
)
{
// The schema for CKEditor5 has changed, therefore we need to check for
// the toolbar items differently.
if
(
$settings
[
'toolbar'
][
'items'
]
&&
in_array
(
$embed_button
->
id
(),
$settings
[
'toolbar'
][
'items'
]))
{
$has_button
=
TRUE
;
}
}
return
AccessResult
::
allowedIf
(
$has_button
)
->
addCacheableDependency
(
$embed_button
)
Loading