Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Periodically patches will be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted simply close this issue (any status besides Active, Needs review or Needs work) or remove the "ProjectUpdateBotD10" tag from the issue.

The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review or Needs work) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD10" tag from the issue.

    You can use Drupal Rector yourself to make these patches.

    If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review or Needs work) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it may be useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the patch in the comment by Project Update Bot.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Infrastructure project issue queue using the component “Bot: Drupal Rector”.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new1.53 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module this patch makes this module compatible with Drupal 10! 🎉
This patch updates the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #139

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.24
  2. palantirnet/drupal-rector: 0.13.0

Lukey made their first commit to this issue’s fork.

ajeet_kumar’s picture

Issue summary: View changes
StatusFileSize
new500 bytes
new17.59 KB
new32.04 KB

I reviewed with patch https://www.drupal.org/files/issues/2023-04-06/3273358-48.patch and found Drupal 10 deprecated issues as

..\contrib\ckeditor_templates\src\Form\CKEditorTemplatesDialogForm.php

Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.. After resolving working as expected CKEditor.

ajeet_kumar’s picture

StatusFileSize
new225.74 KB
ajeet_kumar’s picture

StatusFileSize
new857 bytes

Drupal10 CKEditor_template CKEditor5 compatibility 3273358-48#51.patch
interdiff-3273358-48#51.txt

ajeet_kumar’s picture

abhijityadav’s picture

Status: Needs review » Reviewed & tested by the community
falco010’s picture

Status: Reviewed & tested by the community » Needs review

@ajeet_kumar Your patch has way more changes than needed.

To have Drupal 10 compatibility (to at least upgrade to it), you can use the existing fork that Lukey created above:
https://git.drupalcode.org/project/ckeditor_templates/-/merge_requests/5

The fork can be used by adding this to your composer.json repositories:

        {
            "type": "package",
            "package": {
                "name": "drupal/ckeditor_templates",
                "version": "1.x-dev",
                "type": "drupal-module",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/ckeditor_templates-3296778.git",
                    "reference": "567b63b96949f625ed6aa00af9385e1e59c971f5"
                }
            }
        },

And run the following command:

composer require drupal/ckeditor_templates

Tom M Fallon made their first commit to this issue’s fork.

gordon’s picture

Status: Needs review » Reviewed & tested by the community

I have been doing a lot of testing of this as a part of moving to Drupal 10. I have not found any issues and would make it so much easier.

If you can commit this would be such a huge help for my client.

vincent.hoehn’s picture

Hello folks. We used this module and needed the functionality urgently for CKEditor5 and Drupal 10, so we developed a plugin and module. For all of you who use the functionality, check out ckeditor5_template, maybe it's helpful for someone!

gordon’s picture

I did some more checking and I have removed the composer.json as it added no benefit and a better version will be generated by drupal.org

tom m fallon’s picture

Hey @Gordon

I'm a little bit confused by this. At the moment most contrib modules I've ever come across contain a composer.json.

The reason for adding it was that I was getting

"No valid composer.json was found in any branch or tag of https://git.drupalcode.org/issue/ckeditor_templates-3296778.git, could not load a package from it. "

This error has now returned as my commit was reversed.

The benefit of having a composer.json (even if its replaced later via drupal) is it makes it a lot easier to interact with an issue queue branch. As it stands I've really only been left with the choice to fork this project until this issue merges.

smulvih2’s picture

Agree with @tom, we should include a composer.json file in the module.

Can we get a D10 version released ASAP? I created a custom repository for this module (similar to comment #10) in order to bring this module up to D10. I also have ckeditor_templates_ui module in my build, which does have a D10 version. The only issue is that ckeditor_templates_ui requires ckeditor_templates, so in order to get working with D10 I would have to create a MR for ckeditor_templates_ui that points to the MR for ckeditor_templates, which I don't want to to. ckeditor_templates_ui is mandatory for my project in order to manage the templates.

gordon’s picture

Yes can we please get this committed. It would make things much easier.

However I am using another tool called Drupal lenient, which can install modules that need to be that don’t quite match the criteria.

I am currently down to 2 remain modules which don’t have A d10 release.

b_sharpe’s picture

StatusFileSize
new1.66 KB

Just adding a simple D10 ready (no CKE5) to use with composer.

jaspreet21’s picture

Version: 8.x-1.x-dev » 8.x-1.2
StatusFileSize
new3.1 KB

I am adding the patch which support Drupal coding standards as well in addition to comment number 18.

gordon’s picture

I merged in the @jaspreet21 changes. However I didn't include the changes to the info.yml as retaining compatibility with Drupal 8 is really not realistic.

marcoliver made their first commit to this issue’s fork.

marcoliver’s picture

I agree with Tom that the composer.json should not have been deleted, because not composer refuses to load the module from the issue fork. I've reverted the commit that deleted the composer.json.

captain_haddock’s picture

StatusFileSize
new3.82 KB

Updating patch with changes until 86558271

dpi’s picture

Version: 8.x-1.2 » 8.x-1.x-dev
mtift’s picture

StatusFileSize
new120.08 KB

Code looks good, and I can confirm that the patch works. With Upgrade Status enabled and the patch applied, I see this:

patched module

mysdiir’s picture

Can also confirm that patch with Upgrade Status enabled works.

phernand42’s picture

After updating to Drupal 10.1.5 (and using version 1.2 of module) I started getting the following error in node edit screen even after applying patch in #23.

Deprecated function: Creation of dynamic property Drupal\ckeditor_templates\Plugin\CKEditorPlugin\CkeditorTemplates::$themeExtensionList is deprecated in Drupal\ckeditor_templates\Plugin\CKEditorPlugin\CkeditorTemplates->__construct() (line 58 of modules/contrib/ckeditor_templates/src/Plugin/CKEditorPlugin/CkeditorTemplates.php).

I found that declaring the $themeExtensionList property at the class level, before it's used in the constructor made the error go away.

/**
   * Drupal Theme Extension List.
   *
   * @var \Drupal\Core\Extension\ThemeExtensionList
   */
  private $themeExtensionList;

I'll revise patch in #23 to include this just in case anyone else encounters this error.

phernand42’s picture

StatusFileSize
new4.03 KB

Patch re-rolled to fix error mentioned in #27

leontin made their first commit to this issue’s fork.

pasan.gamage’s picture

The dependency for CK4 should be updated too I think.
https://git.drupalcode.org/project/ckeditor_templates/-/merge_requests/5...

steveoriol’s picture

For D10, dependency should be changed in the "ckeditor_templates.info.yml" file from

 dependencies:
 - drupal:ckeditor

to

 dependencies:
 - drupal:ckeditor5

s_leu made their first commit to this issue’s fork.

s_leu’s picture

Updated the dependency to the ckeditor5 module as suggested in previous posts.

devil2005’s picture

Hi,

Can you release a stable version please (or a dev version that's ok too of course) ?
I have to use zip file and repository isn't up to date (branch 2.x is 3 years old)

Thanks

lucaslg made their first commit to this issue’s fork.

  • lucaslg committed 831ea848 on 8.x-1.x authored by Lukey
    Issue #3296778 by gordon, Lukey, phernand42, Tom M Fallon, marcoliver,...
lucaslg’s picture

Hi,

Sorry for the delay, I know people have been waiting for it. I didn't have much time to work on the subject.

But I did try to follow along the conversation. At first, I didn't understand why people worked on this version as CKEditor 4 support stopped at the same time as Drupal 9. But I discovered in the conversation that having a D10/CK4 version ease the transition of some project to Drupal 10.

I am not sure if the ThemeExtensionList service is the good one to use as it is marked @internal in the documentation and therefore should not be used as a public api if I read it correctly. But that can be corrected later in another issue if needed.

Thanks everyone who participated.
I'll look at the CKEditor 5 issue very soon to have another release.
Sorry again for the delay.

lucaslg’s picture

Status: Reviewed & tested by the community » Fixed
joelpittet’s picture

@lucaslg Thank you for tackling this! On big piece of the puzzle is in!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.