Skip to content

Instantly share code, notes, and snippets.

@junaidpv
Last active February 22, 2024 14:27
Show Gist options
  • Save junaidpv/8686b15c8fabceffb2d4bcf2fdbbecc6 to your computer and use it in GitHub Desktop.
Save junaidpv/8686b15c8fabceffb2d4bcf2fdbbecc6 to your computer and use it in GitHub Desktop.
Changes generated by Rector to make the 3.0.0-rc2 of the wysiwyg_template module work with the D10. Please watch this thread to see if they make a official release of the module for D10.
diff --git a/modules/wysiwyg_template_core/tests/src/Kernel/Plugin/Filter/FilterTemplatesTest.php b/modules/wysiwyg_template_core/tests/src/Kernel/Plugin/Filter/FilterTemplatesTest.php
index 563811a..8663ce4 100644
--- a/modules/wysiwyg_template_core/tests/src/Kernel/Plugin/Filter/FilterTemplatesTest.php
+++ b/modules/wysiwyg_template_core/tests/src/Kernel/Plugin/Filter/FilterTemplatesTest.php
@@ -17,7 +17,7 @@ class FilterTemplatesTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public static $modules = ['filter', 'wysiwyg_template_core'];
+ protected static $modules = ['filter', 'wysiwyg_template_core'];
/**
* The WYSIWYG filter to test.
@@ -29,7 +29,7 @@ class FilterTemplatesTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var \Drupal\filter\FilterPluginManager $manager */
diff --git a/modules/wysiwyg_template_core/wysiwyg_template_core.info.yml b/modules/wysiwyg_template_core/wysiwyg_template_core.info.yml
index cf75289..717f11e 100644
--- a/modules/wysiwyg_template_core/wysiwyg_template_core.info.yml
+++ b/modules/wysiwyg_template_core/wysiwyg_template_core.info.yml
@@ -1,5 +1,5 @@
name: 'Wysiwyg Template Core'
description: 'Core functionality for the Wysiwyg Template module.'
-core_version_requirement: ^8.8 || ^9
+core_version_requirement: ^8.8 || ^9 || ^10
package: 'User interface'
type: module
diff --git a/src/Plugin/CKEditorPlugin/TemplateSelector.php b/src/Plugin/CKEditorPlugin/TemplateSelector.php
index 0d60a91..b313f91 100644
--- a/src/Plugin/CKEditorPlugin/TemplateSelector.php
+++ b/src/Plugin/CKEditorPlugin/TemplateSelector.php
@@ -24,7 +24,7 @@ class TemplateSelector extends CKEditorPluginBase {
return [
'TemplateSelector' => [
'label' => $this->t('Insert templates'),
- 'image' => drupal_get_path('module', 'wysiwyg_template') . '/js/plugins/templateselector/icons/templateselector.png',
+ 'image' => \Drupal::service('extension.list.module')->getPath('wysiwyg_template') . '/js/plugins/templateselector/icons/templateselector.png',
],
];
}
@@ -33,7 +33,7 @@ class TemplateSelector extends CKEditorPluginBase {
* {@inheritdoc}
*/
public function getFile() {
- return drupal_get_path('module', 'wysiwyg_template') . '/js/plugins/templateselector/plugin.js';
+ return \Drupal::service('extension.list.module')->getPath('wysiwyg_template') . '/js/plugins/templateselector/plugin.js';
}
/**
diff --git a/tests/src/Kernel/Controller/TemplateControllerTest.php b/tests/src/Kernel/Controller/TemplateControllerTest.php
index 47c8144..ab579d4 100644
--- a/tests/src/Kernel/Controller/TemplateControllerTest.php
+++ b/tests/src/Kernel/Controller/TemplateControllerTest.php
@@ -20,7 +20,7 @@ class TemplateControllerTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public static $modules = ['system', 'node', 'user', 'wysiwyg_template'];
+ protected static $modules = ['system', 'node', 'user', 'wysiwyg_template'];
/**
* The controller to test.
@@ -46,7 +46,7 @@ class TemplateControllerTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp(); // TODO: Change the autogenerated stub
$this->controller = TemplateController::create($this->container);
diff --git a/tests/src/Kernel/Entity/TemplateTest.php b/tests/src/Kernel/Entity/TemplateTest.php
index cd69b54..88420f9 100644
--- a/tests/src/Kernel/Entity/TemplateTest.php
+++ b/tests/src/Kernel/Entity/TemplateTest.php
@@ -18,7 +18,7 @@ class TemplateTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public static $modules = ['wysiwyg_template', 'node', 'user', 'system'];
+ protected static $modules = ['wysiwyg_template', 'node', 'user', 'system'];
/**
* Node types to test with.
@@ -30,7 +30,7 @@ class TemplateTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->installEntitySchema('wysiwyg_template');
diff --git a/wysiwyg_template.info.yml b/wysiwyg_template.info.yml
index 83801ed..b2dd04d 100644
--- a/wysiwyg_template.info.yml
+++ b/wysiwyg_template.info.yml
@@ -1,6 +1,6 @@
name: 'Wysiwyg Template Plugin'
description: 'Makes the template features for TinyMCE, CK Editor and FCK Editor available to the Wysiwyg API.'
-core_version_requirement: ^8.8 || ^9
+core_version_requirement: ^8.8 || ^9 || ^10
package: 'User interface'
type: module
dependencies:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment