Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 27 March 2024, 9 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

3.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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohit_aghera Rajkot

    Fixed other compatibility issues and improvements.
    - Remove deprecated code
    - Add return types
    - Update hook_help

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohit_aghera Rajkot

    Performing further refactoring.
    - Remove the jquery dependency in the ckeditor-readmore.js file and using vanilla js
    - Remove preprocess hook that was attaching js with each page. Instead we are using filter plugin now.
    It selectively attaches the js with the element.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

    @mohit_aghera Thanks for the Work

    I have reviewed and tested patch #4, it applied cleanly and the CKEditor Read More module is now compatible with druapl 10 after applying the patch. I've attached a before and after screenshot for reference. Please check.

  • Status changed to RTBC over 1 year ago
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohit_aghera Rajkot

    @Akshay kashyap
    This is not a right approach to RTBC issues.
    Here https://www.drupal.org/community/contributor-guide/task/review-a-patch-o... โ†’ are the detailed steps about how to perform the review.
    False RTBC doesn't grant any issue credits.

    It still needs a lot of work to make it fully compatible.
    Switching it to needs review, since it needs inputs from maintainers.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

    Running

    vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/ckeditor_readmore/     
    
    PHP Warning:  Module "fileinfo" is already loaded in Unknown on line 0
    PHP Warning:  Module "gd" is already loaded in Unknown on line 0
    PHP Warning:  Module "gettext" is already loaded in Unknown on line 0
    
    FILE: /home/gai/drupal-git/drupal/modules/ckeditor_readmore/ckeditor_readmore.module
    ------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ------------------------------------------------------------------------------------
     1 | ERROR   | [x] Missing file doc comment
     3 | WARNING | [x] Unused use statement
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    
    FILE: /home/gai/drupal-git/drupal/modules/ckeditor_readmore/src/Plugin/CKEditorPlugin/ReadMore.php
    -------------------------------------------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 3 WARNINGS AFFECTING 11 LINES
    -------------------------------------------------------------------------------------------------------------------
      20 | ERROR   | [x] Opening brace should be on the same line as the declaration
      78 | ERROR   | [x] Doc comment long description must end with a full stop
      86 | ERROR   | [x] Separate the @param and @return sections by a blank line.
     107 | ERROR   | [x] No space found before comment text; expected "// dd($settings);" but found "//dd($settings);"
     112 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     115 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     124 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     127 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     133 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     136 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     140 | ERROR   | [x] Expected 1 blank line after function; 0 found
    -------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/gai/drupal-git/drupal/modules/ckeditor_readmore/src/Plugin/Filter/ReadMoreFilter.php
    ------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------
     14 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
    ------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------
    
    
    FILE: /home/gai/drupal-git/drupal/modules/ckeditor_readmore/README.txt
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------
     12 | WARNING | Line exceeds 80 characters; contains 94 characters
     13 | WARNING | Line exceeds 80 characters; contains 297 characters
     18 | WARNING | Line exceeds 80 characters; contains 86 characters
     23 | WARNING | Line exceeds 80 characters; contains 97 characters
    ----------------------------------------------------------------------
    
    

    Gettings errors need to fix

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

    This patch is based on #4 ... when I tried that one, my "Read more" link printed out multiple times. I've refactored the JS so that it makes use of the drupal/once library. It now works as expected. Please review.

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

    Fix a bug that preventing patch being applied.

  • First commit to issue fork.
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance vanilla-bear

    Hello,

    To be sure patch #11 is compatible ck4 or cke5 ?

    Thanks,

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

    The entire module is only compatible with CKE 4 as far as I know.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohit_aghera Rajkot

    Hi @vanilla-bear
    This patch and module is for CKEditor 4 only.

    For CK5:
    - First we need to port ckeditor plugin itself to CK5 plugin.
    - Later we can tweak the things based on the requirements.

  • Merge request !2Resolve #3296772 "D10 ck4 11" โ†’ (Open) created by vanilla-bear
  • Merge request !3Apply patch #11 โ†’ (Open) created by vanilla-bear
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance vanilla-bear

    Hello, thank you for your response.

    I am in the process of upgrading my site from Drupal 9 to Drupal 10. However, for now, I will stick with CKEditor 4 as it suits my needs perfectly.

    If I can assist someone, I am using this method: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr... โ†’

    Within the composer.json file:

        "repositories": {
            "drupal": {
                "type": "composer",
                "url": "https://packages.drupal.org/8",
                "exclude": [
                    "drupal/ckeditor_readmore"
                ]
            },
            "fork-ckeditor-readmore": {
                "type": "git",
                "url": "https://git.drupalcode.org/issue/ckeditor_readmore-3296772.git"
            },
        },
    

    Command for composer:

    composer require drupal/ckeditor_readmore:dev-3296772-D10-ck4-11#1358e3215c31ebb1b893071b841abb03dd9d636c
    

    This is why I created a fork and integrated your patch, @jaydee1818.

    I have simply added a composer.json file at the root.

    Thanks for your help.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium matthijs

    Drupal 10 with CKEditor 5 support can be found in #3388400.

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

    asherry โ†’ changed the visibility of the branch 3296772-D10-ck4-#11 to hidden.

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

    asherry โ†’ changed the visibility of the branch 3296772-D10-ck4 to hidden.

  • 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! ๐ŸŽ‰
    Therefore 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 #61455

    This patch was created using these packages:

    1. mglaman/phpstan-drupal: 1.2.4
    2. palantirnet/drupal-rector: 0.18.3
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohit_aghera Rajkot

    I think we can close this issue.
    All the changes from this issue are added in #3388400 โœจ CKEditor 5 Support Fixed

    The other issue has all the changes related to Drupal 10 and contains CKEditor5 related compatibility fixes as well.

  • ๐Ÿ‡ธ๐Ÿ‡ฎSlovenia joco_sp
  • Status changed to Fixed 9 months ago
  • ๐Ÿ‡ธ๐Ÿ‡ฎSlovenia joco_sp

    Thank you all for the support! :)
    I merged the code from #3388400 โœจ CKEditor 5 Support Fixed and created the 3.0.0-alpha1 release.

  • Status changed to Fixed 9 months ago
  • ๐Ÿ‡ธ๐Ÿ‡ฎSlovenia joco_sp
Production build 0.71.5 2024