Skip to content
Snippets Groups Projects
Commit a47d0e14 authored by Pravin Gaikwad's avatar Pravin Gaikwad
Browse files

Issue #3288499: Automated Drupal 10 compatibility fixes

parent 3078240f
Branches
Tags
1 merge request!5Issue #3288499: Automated Drupal 10 compatibility fixes
......@@ -23,7 +23,7 @@
"source": "https://git.drupalcode.org/project/media_entity_soundcloud"
},
"require": {
"drupal/core": "^8 || ^9"
"drupal/core": "^9.3 || ^10"
},
"autoload": {
"psr-4": {
......
name: Media Entity Soundcloud
type: module
description: Media entity soundcloud provider.
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.3 || ^10
package: Media
dependencies:
- drupal:media
......@@ -11,7 +11,7 @@ use Drupal\Core\File\FileSystemInterface;
* Implements hook_install().
*/
function media_entity_soundcloud_install() {
$source = drupal_get_path('module', 'media_entity_soundcloud') . '/images/icons';
$source = \Drupal::service('extension.list.module')->getPath('media_entity_soundcloud') . '/images/icons';
$destination = \Drupal::config('media.settings')->get('icon_base_uri');
$file_system = \Drupal::service('file_system');
$file_system->prepareDirectory($destination, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
......
......@@ -67,7 +67,7 @@ class SoundcloudForm extends AddFormBase {
/**
* {@inheritDoc}
*/
protected function buildInputElement(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
protected function buildInputElement(array $form, FormStateInterface $form_state) {
$container = [
'#type' => 'container',
];
......@@ -128,7 +128,7 @@ class SoundcloudForm extends AddFormBase {
/**
* {@inheritDoc}
*/
public function addButtonSubmit(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
public function addButtonSubmit(array $form, FormStateInterface $form_state) {
$this->processInputValues([$form_state->getValue('soundcloud_url')], $form, $form_state);
}
......@@ -138,4 +138,4 @@ class SoundcloudForm extends AddFormBase {
function getFormId() {
return 'soundcloud_media_add_form';
}
}
\ No newline at end of file
}
......@@ -32,7 +32,7 @@ class SoundcloudEmbedFormatterTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
// Setup standalone media urls from the settings.
......@@ -87,7 +87,7 @@ class SoundcloudEmbedFormatterTest extends BrowserTestBase {
$page = $this->getSession()->getPage();
$page->fillField('name[0][value]', 'Soundcloud');
$page->fillField('field_media_soundcloud[0][value]', 'https://soundcloud.com/winguy/billie-jean-remix-ft');
$page->fillField('field_media_soundcloud[0][value]', 'https://soundcloud.com/pooriaputak/laelaha');
$page->pressButton('Save');
// Assert "has been created" text.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment