Revert "Issue #3276974 by hooroomoo, Wim Leers: [drupalMedia] Media View Modes don't work if alignment not enabled"

This reverts commit 72c250879a.
merge-requests/3886/head
catch 2022-04-28 20:55:43 +01:00
parent 1e3566902e
commit 45ee80dd72
3 changed files with 6 additions and 18 deletions

View File

@ -630,7 +630,6 @@ media_media:
ckeditor5:
plugins:
- drupalMedia.DrupalMedia
- drupalMedia.DrupalElementStyle
config:
drupalMedia:
toolbar: [mediaImageTextAlternative]

View File

@ -229,7 +229,12 @@ class MediaLibraryTest extends WebDriverTestBase {
->setFilterConfig('media_embed', [
'status' => TRUE,
'settings' => [
'default_view_mode' => 'view_mode_1',
'allowed_media_types' => $allowed_media_types,
'allowed_view_modes' => [
'view_mode_1' => 'view_mode_1',
'view_mode_2' => 'view_mode_2',
],
],
])->save();

View File

@ -1196,10 +1196,8 @@ class MediaTest extends WebDriverTestBase {
* Tests that view mode is reflected onto the CKEditor 5 Widget wrapper, that
* the media style toolbar allows changing the view mode and that the changes
* are reflected on the widget and downcast drupal-media tag.
*
* @dataProvider providerTestViewMode
*/
public function testViewMode(bool $with_alignment) {
public function testViewMode() {
EntityViewMode::create([
'id' => 'media.view_mode_1',
'targetEntityType' => 'media',
@ -1265,10 +1263,6 @@ class MediaTest extends WebDriverTestBase {
],
])->save();
if (!$with_alignment) {
$filter_format->filters('filter_align')->setConfiguration(array_merge($filter_format->filters('filter_align')->getConfiguration(), ['status' => FALSE]));
}
// Test that view mode dependencies are returned from the MediaEmbed
// filter's ::getDependencies() method.
$expected_config_dependencies = [
@ -1484,16 +1478,6 @@ class MediaTest extends WebDriverTestBase {
$this->assertNotEmpty($this->getBalloonButton('View Mode 4'));
}
/**
* For testing view modes in different scenarios.
*/
public function providerTestViewMode(): array {
return [
'with alignment' => [TRUE],
'without alignment' => [FALSE],
];
}
/**
* Verifies value of an attribute on the downcast <drupal-media> element.
*