Skip to content
Snippets Groups Projects
Unverified Commit de072d10 authored by Aleix Quintana's avatar Aleix Quintana
Browse files

Automated Drupal 10 compatibility fixes #3288300

parent ebeacdca
No related branches found
No related tags found
No related merge requests found
name: 'Licenses vocabulary'
type: module
description: 'Module to add licenses as terms.'
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
package: 'Media'
configure: licenses_vocabulary.licenses_import_form
......@@ -12,7 +12,7 @@ use Drupal\Core\File\FileSystemInterface;
* Implements hook_install().
*/
function licenses_vocabulary_install() {
$source = drupal_get_path('module', 'licenses_vocabulary') . '/images/';
$source = \Drupal::service('extension.list.module')->getPath('licenses_vocabulary') . '/images/';
$destination = \Drupal::config('licenses_vocabulary.settings')->get('icon_base_uri');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
......
......@@ -96,7 +96,7 @@ class LicensesImportForm extends ConfigFormBase {
'#markup' => $info,
];
$image_path = substr(file_url_transform_relative(file_create_url('public://licenses_vocabulary/cc')), 1);
$image_path = substr(\Drupal::service('file_url_generator')->generateString('public://licenses_vocabulary/cc'), 1);
$example_text = "-\n";
$example_text .= " title: Attribution 4.0 International (CC BY 4.0)\n";
$example_text .= " short_label: CC BY 4.0\n";
......
......@@ -67,7 +67,7 @@ class LicensesManager implements LicensesManagerInterface {
* {@inheritdoc}
*/
public function loadDefaultLicenses() {
$file_path = drupal_get_path('module', 'licenses_vocabulary') . '/licenses_vocabulary.default.licenses.yml';
$file_path = \Drupal::service('extension.list.module')->getPath('licenses_vocabulary') . '/licenses_vocabulary.default.licenses.yml';
$file_contents = file_get_contents($file_path);
return $this->loadFromText($file_contents);
}
......
......@@ -17,7 +17,7 @@ class LoadTest extends BrowserTestBase {
*
* @var array
*/
public static $modules = ['licenses_vocabulary'];
protected static $modules = ['licenses_vocabulary'];
/**
* A user with permission to administer site configuration.
......@@ -29,7 +29,7 @@ class LoadTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($this->user);
......
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