Skip to content

Commit

Permalink
10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Sep 8, 2023
1 parent dd147b7 commit 07e8861
Show file tree
Hide file tree
Showing 46 changed files with 75 additions and 93 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
uses: K-Phoen/semver-release-action@master
with:
release_strategy: none
release_branch: main
tag_format: "%major%.%minor%.%patch%"
release_branch: 10.x
tag_format: "10.%minor%.%patch%"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo 'Creating new release for ' ${{ steps.tag.outputs.tag }}
Expand All @@ -32,12 +32,3 @@ jobs:
commit: ${{ github.sha }}
generateReleaseNotes: true
makeLatest: true
- uses: actions/checkout@v3
with:
ref: '9.x'
fetch-depth: 0
- name: Back to Dev
if: ${{ steps.tag.outputs.tag }}
run: |
composer global require su-sws/stanford-caravan:dev-8.x-3.x
~/.composer/vendor/bin/sws-caravan back-to-dev ${{ steps.tag.outputs.tag }} ${{ github.workspace }} main
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
run: |
composer global require su-sws/stanford-caravan:dev-8.x-3.x
composer global require su-sws/stanford-caravan:10.x-dev
~/.composer/vendor/bin/sws-caravan phpunit /var/www/html --extension-dir=$GITHUB_WORKSPACE/project --with-coverage
- name: Save Test Results
uses: actions/upload-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Stanford Media

9.1.0
--------------------------------------------------------------------------------
_Release Date: 2023-09-07_

- Removed drupal core patch that was merged into 10.1 drupal core.

9.0.1
--------------------------------------------------------------------------------
_Release Date: 2023-06-07_
Expand Down
10 changes: 3 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"require": {
"php": ">=8.1",
"davidbarratt/custom-installer": "^1.1",
"drupal/core": "^9.4 || ^10.0",
"drupal/core": "^10.0",
"drupal/dropzonejs": "^2.7",
"drupal/entity_usage": "^2.0@beta",
"drupal/focal_point": "^2.0@alpha",
"drupal/inline_entity_form": "^1.0 || ^2.0",
"drupal/inline_entity_form": "^2.0",
"drupal/oembed_providers": "^2.1",
"drupal/transliterate_filenames": "^2.0",
"enyo/dropzone": "^5.9"
Expand All @@ -37,11 +37,7 @@
"enyo/dropzone"
]
},
"patches": {
"drupal/core": {
"https://www.drupal.org/project/drupal/issues/3059955": "https://www.drupal.org/files/issues/2019-12-28/3082690-80.patch"
}
}
"patches": {}
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 8 additions & 0 deletions config/schema/stanford_media.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,18 @@ field.formatter.settings.embeddable_formatter:
max_height:
type: integer
label: 'Maximum height'
loading:
type: mapping
label: 'oEmbed loading settings'
mapping:
attribute:
type: string
label: 'Loading attribute'
allowed_tags:
type: string
label: 'Allowed HTML tags'


media.source.google_form:
type: media.source.field_aware
label: '"Google Form" media source configuration'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Media Duplicate Validation'
type: module
description: 'Media Validation plugins to help prevent duplication of media items'
core_version_requirement: ^9.4 || ^10
version: 9.0.1
core_version_requirement: ^10
version: 10.0.0
package: media
dependencies:
- drupal:media
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ColorMeanTest extends MediaDuplicateValidationTestBase {
/**
* {@inheritdoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->plugin = $this->duplicationManager->createInstance('color_mean');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Md5Test extends MediaDuplicateValidationTestBase {
/**
* {@inheritdoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->plugin = $this->duplicationManager->createInstance('md5');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class MediaDuplicateValidationTestBase extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('media');
$this->installEntitySchema('file');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @FieldFormatter (
* id = "media_responsive_image_formatter",
* label = @Translation("Media Responsive Image Style"),
* description = @Translation("Apply a responsive image style to image media
* items."), field_types = {
* description = @Translation("Apply a responsive image style to image media items."),
* field_types = {
* "entity_reference"
* }
* )
Expand Down
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: ^9.4 || ^10
core_version_requirement: ^10
package: media
type: module
version: 9.0.1
version: 10.0.0
dependencies:
- dropzonejs:dropzonejs
- drupal:breakpoint
Expand Down
11 changes: 0 additions & 11 deletions stanford_media.module
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,6 @@ function stanford_media_field_widget_text_textarea_form_alter(&$element, FormSta
$element['#attached']['library'][] = 'stanford_media/admin';
}

/**
* Implements hook_ckeditor_css_alter().
*/
function stanford_media_ckeditor_css_alter(array &$css, Editor $editor) {
/** @var \Drupal\Core\Extension\ModuleExtensionList $extensions */
$extensions = \Drupal::service('extension.list.module');
// Add styles inside the ckeditor iframe.
$css[] = $extensions->getPath('stanford_media') . '/dist/css/stanford_media.admin.css';
$css[] = $extensions->getPath('stanford_media') . '/dist/css/stanford_media.css';
}

/**
* Implements hook_theme_registry_alter().
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Form/MediaLibraryEmbeddableFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MediaLibraryEmbeddableFormTest extends StanfordMediaTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installConfig('media_library');

Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Form/MediaLibraryGoogleFormFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MediaLibraryGoogleFormFormTest extends StanfordMediaTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installConfig('media_library');

Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/Form/StanfordMediaDialogFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class StanfordMediaDialogFormTest extends StanfordMediaTestBase {
'media_library',
'views',
'editor',
'ckeditor',
'ckeditor5',
'filter',
];

Expand All @@ -49,7 +49,7 @@ public function testFormStructure() {
FilterFormat::create(['format' => 'html', 'name' => 'test format'])->save();
$editor = Editor::create([
'format' => 'html',
'editor' => 'ckeditor',
'editor' => 'ckeditor5',
]);
$editor->save();
$media = Media::create(['bundle' => 'file']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class EmbeddableFormatterTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('user');
$this->installEntitySchema('media');
Expand Down Expand Up @@ -106,14 +106,12 @@ protected function setUp(): void {
]);
$this->mediaType->save();

$this->mediaType
->set('source_configuration', [
'oembed_field_name' => 'field_media_embeddable_oembed',
'unstructured_field_name' => 'field_media_embeddable_code',
'thumbnails_directory' => 'public://oembed_thumbnails',
'source_field' => 'field_media_embeddable_oembed',
])
->save();
$this->mediaType->set('source_configuration', [
'oembed_field_name' => 'field_media_embeddable_oembed',
'unstructured_field_name' => 'field_media_embeddable_code',
'thumbnails_directory' => 'public://oembed_thumbnails',
'source_field' => 'field_media_embeddable_oembed',
])->save();

// Create the fields we need.
$field_storage = FieldStorageConfig::create([
Expand Down Expand Up @@ -162,15 +160,13 @@ protected function setUp(): void {
];

/** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */

$display = EntityViewDisplay::create([
'targetEntityType' => 'media',
'bundle' => 'embeddable',
'mode' => 'default',
'status' => TRUE,
]);
$display
->setComponent('field_media_embeddable_code', $display_options)
$display->setComponent('field_media_embeddable_code', $display_options)
->setComponent('field_media_embeddable_oembed', $display_options)
->removeComponent('thumbnail')
->save();
Expand Down Expand Up @@ -237,7 +233,6 @@ public function getMagicMethodCallback($method, $args) {
* Formatter should not apply to things that aren't media.
*/
public function testNonMediaField() {

EntityTestBundle::create(['id' => 'test'])->save();

$field_storage = FieldStorageConfig::create([
Expand All @@ -257,14 +252,12 @@ public function testNonMediaField() {
$field_config->save();

$this->assertFalse(EmbeddableFormatter::isApplicable($field_config));

}

/**
* Formatter should not apply to things that aren't embeddable.
*/
public function testOtherMediaTypeField() {

$mediaType = MediaType::create([
'id' => 'video',
'label' => 'video',
Expand All @@ -274,7 +267,6 @@ public function testOtherMediaTypeField() {
$source_field = $mediaType->getSource()->createSourceField($mediaType);

$this->assertFalse(EmbeddableFormatter::isApplicable($source_field));

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class GoogleFormFormatterTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('user');
$this->installEntitySchema('media');
Expand Down Expand Up @@ -160,7 +160,7 @@ public function testGoogleFormatter() {
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('media');
$display = $view_builder->view($this->media, 'default');
$display = \Drupal::service('renderer')->renderPlain($display);

preg_match('/<iframe.*src="http:\/\/google.com\/forms\/a\/b\/formid\/viewform"/', $display, $matches);
$this->assertCount(1, $matches);
preg_match('/<iframe.*height="750".*/', $display, $matches);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class MediaImageFormatterTest extends KernelTestBase {
'field',
'file',
'media',
'entity_reference',
];

/**
Expand All @@ -48,7 +47,7 @@ class MediaImageFormatterTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('user');
$this->installEntitySchema('node');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class MultiMediaFormatterTest extends KernelTestBase {
'field',
'file',
'media',
'entity_reference',
'breakpoint',
'responsive_image',
];
Expand Down Expand Up @@ -79,7 +78,7 @@ class MultiMediaFormatterTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('user');
$this->installEntitySchema('node');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class MediaEmbedMarkupFilterTest extends MediaEmbedFilterTestBase {
'system',
'text',
'user',
'entity_reference',
'breakpoint',
'responsive_image',
'responsive_image_test_module',
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Plugin/media/Source/EmbeddableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EmbeddableTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {

parent::setUp();
$this->installEntitySchema('user');
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Plugin/media/Source/GoogleFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GoogleFormTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('user');
$this->installEntitySchema('media');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EntityUsageLinkTest extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('node');
$this->installEntitySchema('user');
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/StanfordMediaTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class StanfordMediaTestBase extends KernelTestBase {
/**
* {@inheritDoc}
*/
protected function setUp(): void {
public function setup(): void {
parent::setUp();
$this->installEntitySchema('file');
$this->installEntitySchema('user');
Expand Down
Loading

0 comments on commit 07e8861

Please sign in to comment.