Skip to content
Snippets Groups Projects
Commit b6fd2c78 authored by Michael Lee's avatar Michael Lee
Browse files

Merge branch 'video_embed_field' into lee5151

parents 1e8ba1e5 da223c6c
No related branches found
No related tags found
No related merge requests found
Showing
with 81 additions and 77 deletions
......@@ -7437,31 +7437,31 @@
},
{
"name": "drupal/video_embed_field",
"version": "2.4.0",
"version": "2.5.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/video_embed_field.git",
"reference": "8.x-2.4"
"reference": "8.x-2.5"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/video_embed_field-8.x-2.4.zip",
"reference": "8.x-2.4",
"shasum": "96b14bb93c1bb6a07b84315a4f87367870f8b574"
"url": "https://ftp.drupal.org/files/projects/video_embed_field-8.x-2.5.zip",
"reference": "8.x-2.5",
"shasum": "997ed67b6873e822fe628f87f65bd6da67e7350c"
},
"require": {
"drupal/core": "^8.8 || ^9"
"drupal/core": "^9.2 || ^10"
},
"require-dev": {
"drupal/ckeditor": "*",
"drupal/colorbox": "^1.0",
"drupal/ckeditor": "^1",
"drupal/colorbox": "^2",
"drupal/video_embed_media": "*"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-2.4",
"datestamp": "1587686337",
"version": "8.x-2.5",
"datestamp": "1671413311",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......@@ -7470,7 +7470,7 @@
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
"GPL-2.0-or-later"
],
"authors": [
{
......
......@@ -7707,31 +7707,32 @@
},
{
"name": "drupal/video_embed_field",
"version": "2.4.0",
"version_normalized": "2.4.0.0",
"version": "2.5.0",
"version_normalized": "2.5.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/video_embed_field.git",
"reference": "8.x-2.4"
"reference": "8.x-2.5"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/video_embed_field-8.x-2.4.zip",
"reference": "8.x-2.4",
"shasum": "96b14bb93c1bb6a07b84315a4f87367870f8b574"
"url": "https://ftp.drupal.org/files/projects/video_embed_field-8.x-2.5.zip",
"reference": "8.x-2.5",
"shasum": "997ed67b6873e822fe628f87f65bd6da67e7350c"
},
"require": {
"drupal/core": "^8.8 || ^9"
"drupal/core": "^9.2 || ^10"
},
"require-dev": {
"drupal/colorbox": "^1.0",
"drupal/ckeditor": "^1",
"drupal/colorbox": "^2",
"drupal/video_embed_media": "*"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-2.4",
"datestamp": "1587686284",
"version": "8.x-2.5",
"datestamp": "1671413311",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......@@ -7741,12 +7742,12 @@
"installation-source": "dist",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Sam152",
"homepage": "https://www.drupal.org/user/1485048"
"name": "abhinesh",
"homepage": "https://www.drupal.org/user/3645979"
},
{
"name": "jec006",
......@@ -7755,6 +7756,10 @@
{
"name": "plopesc",
"homepage": "https://www.drupal.org/user/282415"
},
{
"name": "Sam152",
"homepage": "https://www.drupal.org/user/1485048"
}
],
"description": "A pluggable field type for storing videos from external video hosts such as Vimeo and YouTube.",
......
......@@ -1229,9 +1229,9 @@
'dev_requirement' => false,
),
'drupal/video_embed_field' => array(
'pretty_version' => '2.4.0',
'version' => '2.4.0.0',
'reference' => '8.x-2.4',
'pretty_version' => '2.5.0',
'version' => '2.5.0.0',
'reference' => '8.x-2.5',
'type' => 'drupal-module',
'install_path' => __DIR__ . '/../../web/modules/video_embed_field',
'aliases' => array(),
......
......@@ -3,10 +3,7 @@
"description": "A pluggable field type for storing videos from external video hosts such as Vimeo and YouTube.",
"type": "drupal-module",
"homepage": "https://www.drupal.org/project/video_embed_field",
"license": "GPL-2.0+",
"require": {
"drupal/core": "^8.8 || ^9"
},
"license": "GPL-2.0-or-later",
"repositories": {
"drupal": {
"type": "composer",
......@@ -14,6 +11,7 @@
}
},
"require-dev": {
"drupal/colorbox": "^1.0"
"drupal/ckeditor": "^1",
"drupal/colorbox": "^2"
}
}
......@@ -3,10 +3,10 @@
* The video_embed_field colorbox integration.
*/
(function($) {
(function($, once) {
Drupal.behaviors.video_embed_field_colorbox = {
attach: function (context, settings) {
$('.video-embed-field-launch-modal', context).once().click(function(e) {
$(once('video-embed-field-launch-modal', '.video-embed-field-launch-modal', context)).click(function(e) {
// Allow the thumbnail that launches the modal to link to other places
// such as video URL, so if the modal is sidestepped things degrade
// gracefully.
......@@ -15,4 +15,4 @@
});
}
};
})(jQuery);
})(jQuery, once);
......@@ -3,10 +3,10 @@
* The video_embed_field lazy loading videos.
*/
(function($) {
(function($, once) {
Drupal.behaviors.video_embed_field_lazyLoad = {
attach: function (context, settings) {
$('.video-embed-field-lazy', context).once().click(function(e) {
$(once('video-embed-field-lazy', '.video-embed-field-lazy', context)).click(function(e) {
// Swap the lightweight image for the heavy JavaScript.
e.preventDefault();
var $el = $(this);
......@@ -14,4 +14,4 @@
});
}
};
})(jQuery);
})(jQuery, once);
......@@ -31,10 +31,10 @@ class oEmbedUpdateTest extends BrowserTestBase {
public function testOEmbedUpdate() {
$mediaType = $this->createMediaType('video_embed_field');
$this->assertEqual($mediaType->getSource()->getPluginId(), 'video_embed_field');
$this->assertEquals($mediaType->getSource()->getPluginId(), 'video_embed_field');
$sourceField = $mediaType->getSource()->getSourceFieldDefinition($mediaType);
$this->assertEqual($sourceField->getType(), 'video_embed_field');
$this->assertEquals($sourceField->getType(), 'video_embed_field');
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = $this->container->get('entity_display.repository');
......@@ -42,7 +42,7 @@ public function testOEmbedUpdate() {
$formDisplay = $display_repository->getFormDisplay('media', $mediaType->id());
$formField = $formDisplay->getComponent($sourceField->getName());
$this->assertEqual($formField['type'], 'video_embed_field_textfield');
$this->assertEquals($formField['type'], 'video_embed_field_textfield');
/** @var \Drupal\vem_migrate_oembed\VemMigrate $vemService */
$vemService = \Drupal::service('vem_migrate_oembed.migrate');
......@@ -50,15 +50,15 @@ public function testOEmbedUpdate() {
/** @var \Drupal\media\Entity\MediaType $mediaType */
$mediaType = MediaType::load($mediaType->id());
$this->assertEqual($mediaType->getSource()->getPluginId(), 'oembed:video');
$this->assertEquals($mediaType->getSource()->getPluginId(), 'oembed:video');
$sourceField = $mediaType->getSource()->getSourceFieldDefinition($mediaType);
$this->assertEqual($sourceField->getType(), 'string');
$this->assertEquals($sourceField->getType(), 'string');
$formDisplay = $display_repository->getFormDisplay('media', $mediaType->id());
$formField = $formDisplay->getComponent($sourceField->getName());
$this->assertEqual($formField['type'], 'oembed_textfield');
$this->assertEquals($formField['type'], 'oembed_textfield');
}
}
......@@ -2,12 +2,12 @@ name: Video Embed Media - Migrate to core oEmbed
type: module
description: 'Provides a drush command to migrate to cores oEmbed'
package: Video Embed Field
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.2 || ^10
dependencies:
- drupal:media (>= 8.6)
- video_embed_field:video_embed_media
# Information added by Drupal.org packaging script on 2020-04-23
version: '8.x-2.4'
# Information added by Drupal.org packaging script on 2022-12-19
version: '8.x-2.5'
project: 'video_embed_field'
datestamp: 1587686287
datestamp: 1671413313
......@@ -24,7 +24,7 @@ class BundleTest extends MediaFunctionalTestBase {
*
* @var array
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
'video_embed_media',
];
......@@ -63,7 +63,7 @@ public function testMediaBundleCreation() {
'field_media_video_embed_field[0][value]' => 'https://www.youtube.com/watch?v=XgYu7-DQjDQ',
], 'Save');
// We should see the video thumbnail on the media page.
$this->assertContains('video_thumbnails/XgYu7-DQjDQ.jpg', $this->getSession()->getPage()->getHtml());
$this->assertStringContainsString('video_thumbnails/XgYu7-DQjDQ.jpg', $this->getSession()->getPage()->getHtml());
}
}
......@@ -31,7 +31,7 @@ class DefaultNameTest extends MediaKernelTestBase {
*
* @var array
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
'video_embed_media',
'media',
......@@ -73,7 +73,7 @@ public function testDefaultName($input, $expected) {
/**
* {@inheritdoc}
*/
public function setUp() {
public function setUp(): void {
parent::setUp();
$this->installConfig(['video_embed_field', 'video_embed_media']);
......
......@@ -32,7 +32,7 @@ class ProvidedFieldsTest extends MediaKernelTestBase {
*
* @var array
*/
public static $modules = [
protected static $modules = [
'video_embed_media',
'video_embed_field',
];
......@@ -114,7 +114,7 @@ public function testProvidedFields($input, $field, $expected) {
/**
* {@inheritdoc}
*/
public function setUp() {
public function setUp(): void {
parent::setUp();
$this->entityType = $this->createMediaType('video_embed_field');
......
......@@ -2,12 +2,12 @@ name: Video Embed Media
type: module
description: 'Integrates video_embed_field with the Media module, creating a new media type tailored to display embedded videos. Useful for websites which are using the media suite of modules.'
package: Video Embed Field
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.2 || ^10
dependencies:
- drupal:media (>= 8.4)
- video_embed_field:video_embed_field
# Information added by Drupal.org packaging script on 2020-04-23
version: '8.x-2.4'
# Information added by Drupal.org packaging script on 2022-12-19
version: '8.x-2.5'
project: 'video_embed_field'
datestamp: 1587686287
datestamp: 1671413313
......@@ -14,7 +14,7 @@ function video_embed_media_install() {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
// Copy the video icons into the right place.
$icon_folder = drupal_get_path('module', 'video_embed_media') . '/images/icons';
$icon_folder = \Drupal::service('extension.list.module')->getPath('video_embed_media') . '/images/icons';
$destination = \Drupal::config('media.settings')->get('icon_base_uri');
$file_system->prepareDirectory($destination, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
......
......@@ -24,7 +24,7 @@ class VideoEmbedWysiwyg extends CKEditorPluginBase implements CKEditorPluginConf
* {@inheritdoc}
*/
public function getFile() {
return drupal_get_path('module', 'video_embed_wysiwyg') . '/plugin/plugin.js';
return \Drupal::service('extension.list.module')->getPath('video_embed_wysiwyg') . '/plugin/plugin.js';
}
/**
......@@ -34,7 +34,7 @@ public function getButtons() {
return [
'video_embed' => [
'label' => $this->t('Video Embed'),
'image' => drupal_get_path('module', 'video_embed_wysiwyg') . '/plugin/icon.png',
'image' => \Drupal::service('extension.list.module')->getPath('video_embed_wysiwyg') . '/plugin/icon.png',
],
];
}
......
......@@ -22,7 +22,7 @@ class TextFormatConfigurationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
'video_embed_wysiwyg',
'editor',
......@@ -42,7 +42,7 @@ class TextFormatConfigurationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->drupalLogin($this->createAdminUser());
......
......@@ -24,7 +24,7 @@ class EmbedDialogTest extends WebDriverTestBase {
*
* @var array
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
'video_embed_wysiwyg',
'editor',
......@@ -44,7 +44,7 @@ class EmbedDialogTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
public function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(array_keys($this->container->get('user.permissions')->getPermissions()));
$this->drupalLogin($this->adminUser);
......@@ -96,7 +96,7 @@ public function testEmbedDialog() {
$this->find('button.form-submit')->click();
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertSession()->pageTextContains('Could not find a video provider to handle the given URL.');
$this->assertContains('http://example.com/', $this->getSession()->getPage()->getHtml());
$this->assertStringContainsString('http://example.com/', $this->getSession()->getPage()->getHtml());
// Submit a valid URL.
$this->find('input[name="video_url"]')->setValue('https://www.youtube.com/watch?v=iaf3Sl2r3jE&t=1553s');
......
......@@ -17,7 +17,7 @@ class FilterTest extends KernelTestBase {
*
* @var array
*/
public static $modules = [
protected static $modules = [
'user',
'system',
'field',
......@@ -104,7 +104,7 @@ public function testVideoFilter($content, $expected) {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->filter = FilterFormat::create([
'format' => 'test_format',
......
......@@ -2,13 +2,13 @@ name: Video Embed WYSIWYG
type: module
description: 'Integrates video_embed_field directly into ckeditor. Useful for websites not using the media suite of modules that need WYSIWYG support.'
package: Video Embed Field
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.2 || ^10
dependencies:
- drupal:field
- drupal:ckeditor
- video_embed_field:video_embed_field
# Information added by Drupal.org packaging script on 2020-04-23
version: '8.x-2.4'
# Information added by Drupal.org packaging script on 2022-12-19
version: '8.x-2.5'
project: 'video_embed_field'
datestamp: 1587686287
datestamp: 1671413313
......@@ -15,7 +15,7 @@
* Implements hook_ckeditor_css_alter().
*/
function video_embed_wysiwyg_ckeditor_css_alter(array &$css, Editor $editor) {
$css[] = drupal_get_path('module', 'video_embed_wysiwyg') . '/plugin/plugin.css';
$css[] = \Drupal::service('extension.list.module')->getPath('video_embed_wysiwyg') . '/plugin/plugin.css';
}
/**
......@@ -32,7 +32,8 @@ function video_embed_wysiwyg_form_filter_format_form_alter(&$form, $form_state,
function video_embed_wysiwyg_toolbar_filter_validate($form, FormStateInterface $form_state) {
$filter_enabled = !empty($form_state->getValue(['filters', 'video_embed_wysiwyg', 'status']));
$button_enabled = FALSE;
$button_rows = json_decode($form_state->getValue(['editor', 'settings', 'toolbar', 'button_groups']), TRUE);
$key = ['editor', 'settings', 'toolbar', 'button_groups'];
$button_rows = $form_state->hasValue($key) ? json_decode($form_state->getValue($key), TRUE) : [];
if (!empty($button_rows)) {
foreach ($button_rows as $button_row) {
foreach ($button_row as $button_group) {
......
......@@ -4,7 +4,7 @@ type: module
hidden: true
package: Testing
# Information added by Drupal.org packaging script on 2020-04-23
version: '8.x-2.4'
# Information added by Drupal.org packaging script on 2022-12-19
version: '8.x-2.5'
project: 'video_embed_field'
datestamp: 1587686287
datestamp: 1671413313
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment