Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3338541
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3338541
Commits
f3b24d25
Unverified
Commit
f3b24d25
authored
3 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3241633
by danflanagan8, benjarlett: View mode doesn't display in dropdown if numerical
parent
3f8d0bd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/filter/src/FilterPluginCollection.php
+1
-1
1 addition, 1 deletion
core/modules/filter/src/FilterPluginCollection.php
core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
+15
-15
15 additions, 15 deletions
...ests/src/FunctionalJavascript/CKEditorIntegrationTest.php
with
16 additions
and
16 deletions
core/modules/filter/src/FilterPluginCollection.php
+
1
−
1
View file @
f3b24d25
...
...
@@ -70,7 +70,7 @@ protected function initializePlugin($instance_id) {
$configuration
=
$this
->
manager
->
getDefinition
(
$instance_id
);
// Merge the actual configuration into the default configuration.
if
(
isset
(
$this
->
configurations
[
$instance_id
]))
{
$configuration
=
NestedArray
::
mergeDeep
(
$configuration
,
$this
->
configurations
[
$instance_id
]);
$configuration
=
NestedArray
::
mergeDeep
Array
([
$configuration
,
$this
->
configurations
[
$instance_id
]
],
TRUE
);
}
$this
->
configurations
[
$instance_id
]
=
$configuration
;
parent
::
initializePlugin
(
$instance_id
);
...
...
This diff is collapsed.
Click to expand it.
core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
+
15
−
15
View file @
f3b24d25
...
...
@@ -1168,11 +1168,11 @@ public function testViewMode() {
'label'
=>
'View Mode 1'
,
])
->
save
();
EntityViewMode
::
create
([
'id'
=>
'media.
view_mode_
2'
,
'id'
=>
'media.
2222
2'
,
'targetEntityType'
=>
'media'
,
'status'
=>
TRUE
,
'enabled'
=>
TRUE
,
'label'
=>
'View Mode 2'
,
'label'
=>
'View Mode 2
has Numeric ID
'
,
])
->
save
();
EntityViewMode
::
create
([
'id'
=>
'media.view_mode_3'
,
...
...
@@ -1191,11 +1191,11 @@ public function testViewMode() {
'mode'
=>
'view_mode_1'
,
])
->
save
();
EntityViewDisplay
::
create
([
'id'
=>
'media.image.
view_mode_
2'
,
'id'
=>
'media.image.
2222
2'
,
'targetEntityType'
=>
'media'
,
'status'
=>
TRUE
,
'bundle'
=>
'image'
,
'mode'
=>
'
view_mode_
2'
,
'mode'
=>
'
2222
2'
,
])
->
save
();
$filter_format
=
FilterFormat
::
load
(
'test_format'
);
...
...
@@ -1206,7 +1206,7 @@ public function testViewMode() {
'allowed_media_types'
=>
[],
'allowed_view_modes'
=>
[
'view_mode_1'
=>
'view_mode_1'
,
'
view_mode_2'
=>
'view_mode_
2'
,
'
22222'
=>
'2222
2'
,
'view_mode_3'
=>
'view_mode_3'
,
],
],
...
...
@@ -1216,12 +1216,12 @@ public function testViewMode() {
// filter's ::getDependencies() method.
$expected_config_dependencies
=
[
'core.entity_view_mode.media.view_mode_1'
,
'core.entity_view_mode.media.
view_mode_
2'
,
'core.entity_view_mode.media.
2222
2'
,
'core.entity_view_mode.media.view_mode_3'
,
];
$dependencies
=
$filter_format
->
getDependencies
();
$this
->
assertArrayHasKey
(
'config'
,
$dependencies
);
$this
->
assert
Same
(
$expected_config_dependencies
,
$dependencies
[
'config'
]);
$this
->
assert
EqualsCanonicalizing
(
$expected_config_dependencies
,
$dependencies
[
'config'
]);
// Test MediaEmbed's allowed_view_modes option setting enables a view mode
// selection field.
...
...
@@ -1236,17 +1236,17 @@ public function testViewMode() {
$page
->
pressButton
(
'Edit media'
);
$this
->
waitForMetadataDialog
();
$assert_session
->
optionExists
(
'attributes[data-view-mode]'
,
'view_mode_1'
);
$assert_session
->
optionExists
(
'attributes[data-view-mode]'
,
'
view_mode_
2'
);
$assert_session
->
optionExists
(
'attributes[data-view-mode]'
,
'
2222
2'
);
$assert_session
->
optionNotExists
(
'attributes[data-view-mode]'
,
'view_mode_3'
);
$assert_session
->
selectExists
(
'attributes[data-view-mode]'
)
->
selectOption
(
'
view_mode_
2'
);
$assert_session
->
selectExists
(
'attributes[data-view-mode]'
)
->
selectOption
(
'
2222
2'
);
$this
->
submitDialog
();
$this
->
getSession
()
->
switchToIFrame
(
'ckeditor'
);
$this
->
assertNotEmpty
(
$assert_session
->
waitForElementVisible
(
'css'
,
'article.media--view-mode-
view-mode-
2'
));
$this
->
assertNotEmpty
(
$assert_session
->
waitForElementVisible
(
'css'
,
'article.media--view-mode-
_222
2'
));
// Test that the downcast drupal-media element contains the
// `data-view-mode` attribute set in the dialog.
$this
->
pressEditorButton
(
'source'
);
$this
->
assertNotEmpty
(
$drupal_media
=
$this
->
getDrupalMediaFromSource
());
$this
->
assertSame
(
'
view_mode_
2'
,
$drupal_media
->
getAttribute
(
'data-view-mode'
));
$this
->
assertSame
(
'
2222
2'
,
$drupal_media
->
getAttribute
(
'data-view-mode'
));
// Press the source button again to leave source mode.
$this
->
pressEditorButton
(
'source'
);
...
...
@@ -1289,7 +1289,7 @@ public function testViewMode() {
'allowed_media_types'
=>
[],
'allowed_view_modes'
=>
[
'view_mode_1'
=>
'view_mode_1'
,
'
view_mode_2'
=>
'view_mode_
2'
,
'
22222'
=>
'2222
2'
,
],
],
])
->
save
();
...
...
@@ -1297,11 +1297,11 @@ public function testViewMode() {
// Test that the dependencies change when the allowed_view_modes change.
$expected_config_dependencies
=
[
'core.entity_view_mode.media.view_mode_1'
,
'core.entity_view_mode.media.
view_mode_
2'
,
'core.entity_view_mode.media.
2222
2'
,
];
$dependencies
=
$filter_format
->
getDependencies
();
$this
->
assertArrayHasKey
(
'config'
,
$dependencies
);
$this
->
assert
Same
(
$expected_config_dependencies
,
$dependencies
[
'config'
]);
$this
->
assert
EqualsCanonicalizing
(
$expected_config_dependencies
,
$dependencies
[
'config'
]);
// Test that setting the view mode back to the default removes the
// `data-view-mode` attribute.
...
...
@@ -1309,7 +1309,7 @@ public function testViewMode() {
$page
->
pressButton
(
'Edit media'
);
$this
->
waitForMetadataDialog
();
$assert_session
->
optionExists
(
'attributes[data-view-mode]'
,
'view_mode_1'
);
$assert_session
->
optionExists
(
'attributes[data-view-mode]'
,
'
view_mode_
2'
);
$assert_session
->
optionExists
(
'attributes[data-view-mode]'
,
'
2222
2'
);
$assert_session
->
selectExists
(
'attributes[data-view-mode]'
)
->
selectOption
(
'view_mode_1'
);
$this
->
submitDialog
();
$this
->
getSession
()
->
switchToIFrame
(
'ckeditor'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment