Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 21 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

Needs work

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.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance Guillaume Aveline

    Guillaume Aveline โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul1707

    I have tested this patch in Drupal 9.5.7 and 10.0.3. Patch applied cleanly and working as expected. So, moving this to RTBC.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul1707

    I have tested this patch in Drupal 9.5.7 and 10.0.3. Patch applied cleanly and working as expected. So, moving this to RTBC.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mradcliffe USA
    1. +++ b/ckeditor_entity_link.info.yml
      @@ -1,8 +1,7 @@
       dependencies:
      

      The module depends on `drupal/ckeditor` which no longer exists in Drupal 10. This should be changed to `drupal/ckeditor5` if a hard dependency is needed.

    2. +++ b/src/Form/CKEditorEntityLinkDialog.php
      @@ -224,7 +224,7 @@ class CKEditorEntityLinkDialog extends FormBase implements BaseFormIdInterface {
      +          $url = \Drupal::service('file_url_generator')->generateAbsoluteString($file->getFileUri());
      

      The dependency should be injected instead.

    3. +++ b/src/Plugin/CKEditorPlugin/EntityLink.php
      +++ b/src/Plugin/CKEditorPlugin/EntityLink.php
      @@ -19,7 +19,7 @@ class EntityLink extends CKEditorPluginBase {
      

      CKEditorPluginBase does not exist in Drupal 10.

      I think this class/change could remain unchanged if a new "CKEditor5EntityLink" plugin was created.

    4. +++ b/src/Plugin/CKEditorPlugin/EntityLink.php
      @@ -19,7 +19,7 @@ class EntityLink extends CKEditorPluginBase {
      +    return \Drupal::service('extension.list.module')->getPath('ckeditor_entity_link') . '/js/plugins/entitylink/plugin.js';
      
      @@ -45,7 +45,7 @@ class EntityLink extends CKEditorPluginBase {
      +    $path = \Drupal::service('extension.list.module')->getPath('ckeditor_entity_link') . '/js/plugins/entitylink';
      

      In that new plugin, these dependencies should be injected.

    I'm not sure if it's possible to make this compatible with both Drupal 9 and Drupal 10. To make it compatible with Drupal 9, a separate CKEditor5 plugin should be created. To make it compatible with Drupal 10, a new branch should be used that only includes dependency on ckeditor5 and/or the ckeditor5 plugin.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    Comments addressed.
    Switching to version 10 because of the ckeditor5 module and CKEditor5PluginDefault dependency.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    Looks like D10 version needs to be separate from D9.
    Still work in progress.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain navneet0693 Madrid

    Just adding link to https://www.drupal.org/project/ckeditor_entity_link/issues/3312523 ๐Ÿ“Œ CKEditor 5 support: merge with Linkit? Active

  • ๐Ÿ‡ช๐Ÿ‡ธSpain navneet0693 Madrid

    I have just created a fork of this module at https://github.com/navneet0693/ckeditor_entity_link which is working with Drupal 10. I am dropping the link here just in case someone needs this for Drupal 10 based project.

  • ๐Ÿ‡ต๐Ÿ‡ฐPakistan usmanjutt84 Islamabad

    Looks like Linkit โ†’ module works perfectly with ckEditor 5 module in Drupal 10. I am already using it in one of my project.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    @usmanjutt84 ^10.0 means it works with both 10.0 and 10.1 same as ^9.4 works with both 9.4 and 9.5.

  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • Changed it to ^10, please review.

  • I was thinking, shouldn't we create a release to still require ckeditor 4?

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    CKeditor4 and Drupal9 have two months to live.
    Don't think it worth it.

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

    @joaopauloscho
    Removing ^9 and keeping only ^10 breaks the module in the process of updating to D10.
    I think it won't hurt keeping it ^9 || ^10

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States alphex Atlanta, GA USA

    @joaopauloscho
    @VladimirAus

    Decisions like this make upgrading a D9 site to D10 more difficult for people who are less comfortable with composer.

    For those of us who have D9 sites, we have to make a decision to keep or upgrade CKEditor4... And in my case, for most of my sites, I'm keeping CKEDITOR 5 cause many features my clients use on CK4 aren't ready yet.

    I suggest removing the ckeditor requirement

    and keeping 9 in the core requirements,

    That way people who are doing the upgrade can make their own mind up about CK4, but don't have to do any composer song and dance to do the Drupal 10 upgrade.

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

    I would assume ^8.x-1.3 would keep ck4 and support d9 and d10 for upgrade. Removing d9 support would mean you should need a new branch.

    If there is a version of this module that is ck5 compatible, it would be it's own branch going forward like 2.0.0 that requires d10 and ck5, but not d9 compatible.

    This allows ck4 people to update and stay on ck4 if they have to. And ck5 people can learn about and leverage this tool.

    thanks to those working on this! It would be helfpul to at least have a new dev release with d10 support from #3. But in the meantime, I think I'll have to use composer-drupal-lenient to move forward with that patch in composer.

  • Status changed to RTBC 12 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    MR!3 works for CKEditor4.
    MR!1 crashes for CKEditor4.

  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mradcliffe USA

    Now that there is partial work committed, a ckeditor5 plugin needs to be written so that the module is compatible with Drupal 10 core editor.

Production build 0.71.5 2024