Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 14 December 2023, 11 months ago

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โ€.

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ajeet_kumar gurugaon

    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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ajeet_kumar gurugaon
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ajeet_kumar gurugaon

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ajeet_kumar gurugaon
  • Status changed to RTBC over 1 year ago
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands falco010 ๐Ÿ‡ณ๐Ÿ‡ฑ The Netherlands

    @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
    
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom Tom M Fallon

    Tom M Fallon โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia gordon Melbourne

    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.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany vincent.hoehn Dresden, Germany

    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!

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia gordon Melbourne

    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

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom Tom M Fallon

    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.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada smulvih2 Canada ๐Ÿ

    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.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia gordon Melbourne

    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.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada b_sharpe

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaspreet21

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

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia gordon Melbourne

    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.

  • First commit to issue fork.
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany marcoliver Neuss, NRW, Germany

    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.

  • ๐Ÿ‡ง๐Ÿ‡ฉBangladesh captain_haddock

    Updating patch with changes until 86558271

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia dpi Perth, Australia

    Restoring to prevent ๐Ÿ“Œ Automated Drupal 10 compatibility fixes Needs review

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mtift Minnesota, USA

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

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Istari

    Can also confirm that patch with Upgrade Status enabled works.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phernand42

    After updating to Drupal 10.1.5 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.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phernand42

    Patch re-rolled to fix error mentioned in #27

  • First commit to issue fork.
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia pasan.gamage

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

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance steveoriol Grenoble ๐Ÿ‡ซ๐Ÿ‡ท

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

     dependencies:
     - drupal:ckeditor

    to

     dependencies:
     - drupal:ckeditor5
  • First commit to issue fork.
  • Updated the dependency to the ckeditor5 module as suggested in previous posts.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance devil2005

    Hi,

    Can you release a stable version please ?
    I have to use zip file and repository isn't up to date (branch 2.x is 3 years old)

    Thanks

  • First commit to issue fork.
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance lucaslg

    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.

  • Status changed to Fixed 12 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance lucaslg
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada joelpittet Vancouver

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

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

Production build 0.71.5 2024