Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 11.1.0 #153

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Stanford Media

11.1.0
--------------------------------------------------------------------------------
_Release Date: 2024-06-26_

- D11 upgrades, requires D10.3
- Logger syntax bug fix.

11.0.3
--------------------------------------------------------------------------------
_Release Date: 2024-03-14_
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@
"require": {
"php": ">=8.1",
"davidbarratt/custom-installer": "^1.1",
"drupal/core": "^10.2",
"drupal/core": "^10.3 || ^11",
"drupal/dropzonejs": "^2.7",
"drupal/entity_usage": "^2.0@beta",
"drupal/focal_point": "^2.0@alpha",
"drupal/inline_entity_form": "^3.0",
"drupal/oembed_providers": "^2.1",
"enyo/dropzone": "^5.9"
},
"conflict": {
"drupal/ckeditor": "*"
},
"extra": {
"custom-installer": {
"docroot/libraries/{$name}/": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Media Duplicate Validation'
type: module
description: 'Media Validation plugins to help prevent duplication of media items'
core_version_requirement: ^10
core_version_requirement: ^10 || ^11
version: 10.0.0
package: media
dependencies:
Expand Down
136 changes: 0 additions & 136 deletions src/Form/StanfordMediaDialogForm.php

This file was deleted.

1 change: 1 addition & 0 deletions src/Plugin/MediaEmbedDialogBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ abstract class MediaEmbedDialogBase extends PluginBase implements MediaEmbedDial
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {

return new static(
$configuration,
$plugin_id,
Expand Down
3 changes: 0 additions & 3 deletions src/Routing/RouteSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection->get('entity.media.add_page')) {
$route->setDefault('_controller', MediaAdd::class . '::addPage');
}
if ($route = $collection->get('editor.media_dialog')) {
$route->setDefault('_form', StanfordMediaDialogForm::class);
}
}

}
4 changes: 2 additions & 2 deletions stanford_media.info.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Stanford Media
description: Provides media module configuration and plugins.
core_version_requirement: ^10.2
core_version_requirement: ^10.2 || 11
package: media
type: module
version: 11.0.3
version: 11.1.0
dependencies:
- dropzonejs:dropzonejs
- drupal:breakpoint
Expand Down
9 changes: 9 additions & 0 deletions stanford_media.install
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ function stanford_media_update_11001() {
$config->clear('filters.stanford_media_embed_markup')->save();
}
}
}

/**
* Check if ckeditor installed.
*/
function stanford_media_update_11002() {
if (\Drupal::moduleHandler()->moduleExists('ckeditor')) {
throw new \Exception('Stanford Media is not compatible with ckeditor');
}
}
74 changes: 0 additions & 74 deletions tests/src/Kernel/Form/StanfordMediaDialogFormTest.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class EmbeddableFormatterTest extends KernelTestBase {
'field',
'file',
'entity_test',
'path_alias',
];

/**
Expand Down Expand Up @@ -82,6 +83,7 @@ public function setup(): void {
parent::setUp();
$this->installEntitySchema('user');
$this->installEntitySchema('media');
$this->installEntitySchema('path_alias');
$this->installConfig('media');
$this->installEntitySchema('field_storage_config');
$this->installEntitySchema('field_config');
Expand Down Expand Up @@ -288,7 +290,7 @@ public function testEmbeddableFormatter() {
$view_builder = \Drupal::entityTypeManager()
->getViewBuilder('media');
$view_render = $view_builder->view($this->unstructured_media, 'default');
$rendered_view = \Drupal::service('renderer')->renderPlain($view_render);
$rendered_view = \Drupal::service('renderer')->renderInIsolation($view_render);
$this->assertStringContainsString('http://www.test.com', $rendered_view);

$view_builder = \Drupal::entityTypeManager()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testGoogleFormatter() {

$view_builder = \Drupal::entityTypeManager()->getViewBuilder('media');
$display = $view_builder->view($this->media, 'default');
$display = \Drupal::service('renderer')->renderPlain($display);
$display = \Drupal::service('renderer')->renderInIsolation($display);

preg_match('/<iframe.*src="http:\/\/google.com\/forms\/a\/b\/formid\/viewform"/', $display, $matches);
$this->assertCount(1, $matches);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function testFieldFormatter() {
$view_builder = \Drupal::entityTypeManager()
->getViewBuilder('node');
$node_render = $view_builder->view($node, 'default');
$rendered_node = \Drupal::service('renderer')->renderPlain($node_render);
$rendered_node = \Drupal::service('renderer')->renderInIsolation($node_render);
preg_match_all('/<a.*href="\/node\/.*\/large\/.*\/logo.png.*\/a>/s', $rendered_node, $preg_match);
$this->assertNotEmpty($preg_match[0]);
preg_match_all('/alt="Foo Bar Alt"/', $rendered_node, $preg_match);
Expand All @@ -175,7 +175,7 @@ public function testFieldFormatter() {
$view_builder = \Drupal::entityTypeManager()
->getViewBuilder('node');
$node_render = $view_builder->view($node, 'default');
$rendered_node = \Drupal::service('renderer')->renderPlain($node_render);
$rendered_node = \Drupal::service('renderer')->renderInIsolation($node_render);
preg_match_all('/<a.*href="\/node\/.*\/large\/.*\/logo.png.*\/a>/s', $rendered_node, $preg_match);
$this->assertNotEmpty($preg_match[0]);
preg_match_all('/alt="Foo Bar Alt"/', $rendered_node, $preg_match);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private function getRenderedNode($node, $view_mode = 'default') {
$view_builder = \Drupal::entityTypeManager()
->getViewBuilder('node');
$node_render = $view_builder->view($node, $view_mode);
return \Drupal::service('renderer')->renderPlain($node_render);
return \Drupal::service('renderer')->renderInIsolation($node_render);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/src/Kernel/Plugin/media/Source/EmbeddableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class EmbeddableTest extends KernelTestBase {
'field',
'file',
'stanford_media',
'path_alias',
];

/**
Expand Down Expand Up @@ -70,6 +71,7 @@ public function setup(): void {
$this->installEntitySchema('field_storage_config');
$this->installEntitySchema('field_config');
$this->installEntitySchema('file');
$this->installEntitySchema('path_alias');
$this->installSchema('file', ['file_usage']);
$this->installConfig('system');

Expand Down
3 changes: 3 additions & 0 deletions tests/src/Kernel/StanfordMediaTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ abstract class StanfordMediaTestBase extends KernelTestBase {
'media',
'media_library',
'views',
'filter',
'path_alias',
];

/**
Expand All @@ -36,6 +38,7 @@ public function setup(): void {
$this->installEntitySchema('file');
$this->installEntitySchema('user');
$this->installEntitySchema('media');
$this->installEntitySchema('path_alias');
$this->installSchema('file', ['file_usage']);
$this->installSchema('system', ['sequences']);
$this->installConfig('system');
Expand Down
Loading