Automated Drupal 11 compatibility fixes for embed

Created on 17 March 2024, 9 months ago

Problem/Motivation

Hello project maintainers,

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

Changes will periodically be added to this issue that remove deprecated API uses. To stop further changes from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD11" tag from the issue to stop the bot from posting updates.

The changes 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 changes until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD11" tag is left on this issue, new changes 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 changes posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot changes. The bot will still post new changes then if there is a change in the new generated patch compared to the changes that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated changes.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated changes, remove the "ProjectUpdateBotD11" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated changes again, add back the "ProjectUpdateBotD11" 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, Needs work and Reviewed and tested by the community) and no more automated changes will be posted here.

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

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

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Using the merge request

  1. Review the merge request and test it.
  2. Thoroughly test the changes. These changes are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the merge request, create a new branch and merge request and work from there.

Warning: The 'project-update-bot-only' branch will always be overwritten. Do not work in that branch!

Providing feedback

If there are problems with one of the changes 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 Project analysis issue queue .

📌 Task
Status

Needs review

Version

1.7

Component

Code

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

Merge Requests

Comments & Activities

  • Issue created by @project update bot
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

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

    Debug info

    Bot run #11-121090

    This patch was created using these packages:

    1. drupal/upgrade_status: 4.1.0
    2. mglaman/phpstan-drupal: 1.2.7
    3. palantirnet/drupal-rector: 0.20.1
  • Pipeline finished with Failed
    9 months ago
    #121445
  • Pipeline finished with Failed
    9 months ago
    #121446
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.

    Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

    The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

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

    Debug information

    Bot run #11-177898

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.1
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.1
  • Pipeline finished with Failed
    7 months ago
    Total: 207s
    #178313
  • First commit to issue fork.
  • Merge request !16Drupal 11 Compatibility. → (Merged) created by deepakkm
  • Pipeline finished with Failed
    7 months ago
    Total: 239s
    #180247
  • Status changed to Needs work 7 months ago
  • 🇮🇳India deepakkm

    Hello @dave-reid - I have a suggestion on the new release for embed module and was thinking if there is any plan to drop Drupal 9 support as it has ckeditor4 dependency which will not be supported in Drupal 11. Would it be ok if i create an MR with dropped support for Drupal 9?

  • Pipeline finished with Failed
    7 months ago
    Total: 172s
    #184998
  • Pipeline finished with Success
    7 months ago
    Total: 272s
    #185686
  • Status changed to Needs review 7 months ago
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

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

    Debug information

    Bot run #11-185727

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.1
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.1
  • Pipeline finished with Failed
    7 months ago
    Total: 273s
    #186142
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

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

    Debug information

    Bot run #11-188138

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.2
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.2
  • Pipeline finished with Failed
    7 months ago
    Total: 200s
    #188772
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

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

    Debug information

    Bot run #11-188815

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.2
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.2
  • Pipeline finished with Failed
    7 months ago
    Total: 207s
    #188934
  • Status changed to Needs work 7 months ago
  • 🇮🇳India chandu7929 Pune

    @deepakkm - I verified MR 16 and can see following deprecations, hence needs work.

    ================================================================================
    Embed, --
    Scanned on Wed, 06/05/2024 - 06:23
    
    FILE: modules/contrib/embed/src/Form/EmbedButtonForm.php
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 117  Call to deprecated function watchdog_exception(). Deprecated
                        in drupal:10.1.0 and is removed from drupal:11.0.0. Use Use 
                        Drupal\Core\Utility\Error::logException() instead.          
    --------------------------------------------------------------------------------
    
    FILE: modules/contrib/embed/tests/src/Unit/DomHelperTraitTest.php
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 35   Missing call to parent::setUp() method.                     
    --------------------------------------------------------------------------------
    
  • Assigned to prabha1997
  • 🇮🇳India prabha1997

    I am working on this issue

  • Pipeline finished with Failed
    7 months ago
    Total: 171s
    #191527
  • Pipeline finished with Success
    7 months ago
    Total: 169s
    #191538
  • 🇮🇳India deepakkm

    Remaining phpcs and phpstan issue should be fixed as part of separate ticket. I think MR 16 is enough for drupal 11 comptability

  • Status changed to Needs review 7 months ago
  • Status changed to Needs work 7 months ago
  • Pipeline finished with Canceled
    7 months ago
    Total: 24s
    #191648
  • Pipeline finished with Success
    7 months ago
    Total: 176s
    #191650
  • Status changed to Needs review 7 months ago
  • Status changed to Needs work 7 months ago
  • 🇮🇳India vishalkhode

    Requested some changes in MR. Please see. Hence, moving it back.

  • Pipeline finished with Failed
    7 months ago
    Total: 235s
    #192444
  • Pipeline finished with Success
    7 months ago
    Total: 222s
    #192458
  • Issue was unassigned.
  • Pipeline finished with Failed
    7 months ago
    Total: 194s
    #192568
  • Pipeline finished with Success
    7 months ago
    Total: 206s
    #192572
  • Pipeline finished with Success
    7 months ago
    Total: 331s
    #192626
  • Pipeline finished with Canceled
    7 months ago
    Total: 130s
    #192635
  • Pipeline finished with Failed
    7 months ago
    Total: 570s
    #192639
  • Pipeline finished with Success
    7 months ago
    Total: 172s
    #192655
  • Status changed to Needs review 7 months ago
  • Status changed to RTBC 6 months ago
  • 🇮🇳India rajeshreeputra Pune

    Verified changes with Drupal 11 rc version and working fine.

  • Status changed to Needs work 6 months ago
  • Pipeline finished with Success
    6 months ago
    Total: 172s
    #195554
  • Pipeline finished with Success
    6 months ago
    Total: 266s
    #196107
  • 🇮🇳India ankitv18

    ankitv18 changed the visibility of the branch project-update-bot-only to hidden.

  • Status changed to Needs review 6 months ago
  • Status changed to RTBC 6 months ago
  • 🇮🇳India ankitv18

    Changes done in the MR!16 looks fine by me, hence marking this RTBC.
    Also I'm linking the other issues.

  • Status changed to Needs review 6 months ago
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

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

    Debug information

    Bot run #11-199781

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.2
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.3
  • Pipeline finished with Failed
    6 months ago
    Total: 177s
    #201406
  • Status changed to RTBC 6 months ago
  • 🇮🇳India vipin.mittal18 Greater Noida

    MR !16 is D11 compatible

  • Status changed to Needs work 5 months ago
  • 🇦🇺Australia kim.pepper 🏄‍♂️🇦🇺Sydney, Australia

    Left some feedback.

  • Pipeline finished with Failed
    5 months ago
    Total: 176s
    #226187
  • Pipeline finished with Success
    5 months ago
    Total: 135s
    #226193
  • Pipeline finished with Success
    5 months ago
    Total: 160s
    #226204
  • Status changed to Needs review 5 months ago
  • Pipeline finished with Success
    5 months ago
    #233074
  • Pipeline finished with Failed
    5 months ago
    Total: 152s
    #237009
  • Pipeline finished with Failed
    5 months ago
    Total: 143s
    #237012
  • Pipeline finished with Failed
    5 months ago
    Total: 159s
    #237034
  • Pipeline finished with Failed
    5 months ago
    Total: 151s
    #237069
  • Status changed to Needs work 5 months ago
  • 🇮🇳India deepakkm

    As per discussion we are going to refactor functionaljavascript test for ckeditor and change it to ckeditor5.

  • Status changed to Needs review 5 months ago
  • Pipeline finished with Success
    5 months ago
    Total: 144s
    #238069
  • Pipeline finished with Failed
    5 months ago
    #238346
  • Pipeline finished with Failed
    5 months ago
    Total: 581s
    #238351
  • Pipeline finished with Success
    5 months ago
    Total: 153s
    #238425
  • Pipeline finished with Success
    5 months ago
    Total: 152s
    #238432
  • Status changed to RTBC 5 months ago
  • 🇮🇳India rajeshreeputra Pune

    I have reviewed the changes, and everything looks good to me, also validated on local.

  • First commit to issue fork.
  • Status changed to Needs review 4 months ago
  • 🇺🇸United States phenaproxima Massachusetts

    A couple of questions, and I see that most of the "validate" stage of the build pipeline is still failing: https://git.drupalcode.org/project/embed/-/pipelines/245832

    Any chance we can fix those things here? Or at least open a follow-up issue to fix them?

  • Pipeline finished with Success
    4 months ago
    Total: 4133s
    #246442
  • Pipeline finished with Success
    4 months ago
    Total: 195s
    #246523
  • Pipeline finished with Success
    4 months ago
    #246595
  • Pipeline finished with Success
    4 months ago
    #246609
  • 🇮🇳India chandu7929 Pune

    Fixed phpstan and phpcs issue, hence requesting review.

  • Pipeline finished with Success
    4 months ago
    #246648
  • Status changed to RTBC 4 months ago
  • 🇮🇳India ankitv18

    All pipelines are green now ~~ hence marking this RTBC!!

  • Status changed to Needs work 4 months ago
  • 🇺🇸United States phenaproxima Massachusetts

    Nice. I think we need a few more things here, though - mostly uses of DeprecationHelper, and a follow-up.

  • Pipeline finished with Failed
    4 months ago
    #246786
  • Pipeline finished with Running
    4 months ago
    #246791
  • Pipeline finished with Success
    4 months ago
    #246798
  • Status changed to RTBC 4 months ago
  • Status changed to Needs review 4 months ago
  • Status changed to RTBC 4 months ago
  • 🇺🇸United States phenaproxima Massachusetts

    ❤️

  • 🇺🇸United States phenaproxima Massachusetts
  • Pipeline finished with Skipped
    4 months ago
    #246812
  • Status changed to Fixed 4 months ago
  • 🇺🇸United States phenaproxima Massachusetts
  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    The changes in this commit have caused significant compatibility issues. The changes to EmbedTypeBase::__construct() caused 🐛 Entity Embed fails to install after Embed module update Active . Deleting EmbedCKEditorPluginBase cause problems with any module that extends this, such as in entity_embed.

    These changes are big enough that they should be done in a new minor or major version of the module. I suggest reverting this commit, making a 8.x-1.9 release, and creating a 2.0.x branch from version 8.x-1.8.

  • 🇺🇸United States jayemel

    Updating to embed 1.8 has broken our ability to use entity_embed in ckeditor5. We get a spinner, then nothing. This essentially breaks any site building for us.

    In the logs we get:

    ArgumentCountError: Too few arguments to function Drupal\embed\EmbedType\EmbedTypeBase::__construct(), 3 passed in /code/web/modules/contrib/entity_embed/src/Plugin/EmbedType/Entity.php on line 56 and exactly 4 expected in Drupal\embed\EmbedType\EmbedTypeBase->__construct() (line 29 of /code/web/modules/contrib/embed/src/EmbedType/EmbedTypeBase.php).

    What is the solution? Where is the embed module even coming from, it's not in our composer.json. Is it in core? We need to lock it down to 1.7 because 1.8 has broken our sites.

  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    To constrain it, in your project, run: composer require 'drupal/embed:1.7'

  • 🇦🇺Australia mstrelan

    Rather than running composer require you can add a conflict on 1.8.0, or if you prefer you can use ~1.8.0 or >= 1.8.0

    "conflict": {
      "drupal/embed": "1.8.0"
    }
    

    This will allow it to upgrade to 8.x-1.9 when it's out, assuming that will fix the issue.

  • 🇺🇸United States phenaproxima Massachusetts

    I reverted this commit and released 1.9. Whoops! I suspect this is a CKEditor 4 compatibility issue, so we'll do whatever work is needed in the 2.0.x branch.

  • Status changed to Needs work 4 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Reopening this then.

    ckeditor might cause issues too but the main problem is the EmbedTypeBase constructur.

    It's a good example why I always recommend to not mix coding standards with compatibility patches. There's no need to rush that in. With that removed/made optional it shouldn't be necessary to add a 2.x branch, maybe it makes sense for the ckeditor stuff, not sure.

  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    I suggest making a release node for the 2.0.x branch. That would allow setting the version of this issue to 2.0.x. Tests are passing. 8.x-1.x could be maintained for only Drupal 10, so no need for any D11 compatibility patches.

  • 🇨🇭Switzerland berdir Switzerland

    And my suggestion is to try and avoid a 2.x release. This project is barely maintained as it is, a new release branch is not going to help with that.

    It might not even be necessary to drop the ckeditor integration. entity_browser has passing (some) tests on D11 on top of ckeditor + embed + entity_embed, all it takes is lenient + a sed command: https://git.drupalcode.org/project/entity_browser/-/blob/8.x-2.x/.gitlab....

    My suggestion would be to reduce this MR to the minimal change that it takes to have green tests on D11 and move everything else to other issues.

  • Merge request !24Resolve #3430097 "Automated drupal 11" → (Open) created by kim.pepper
  • Status changed to Needs review 4 months ago
  • 🇦🇺Australia kim.pepper 🏄‍♂️🇦🇺Sydney, Australia

    Created a new MR based off MR!16 that adds BC support to EmbedTypeBase::__construct(). I assume this is all we need?

  • Pipeline finished with Failed
    4 months ago
    Total: 206s
    #252329
  • Pipeline finished with Success
    4 months ago
    Total: 161s
    #252336
  • Status changed to Needs work 4 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Left one comment, but the ckeditor4 integration removal is IMHO still a bit problematic for a minor update. If nothing else, it breaks entity_browser/tests/src/FunctionalJavascript/EntityEmbedCKEditor4Test.php. And I expect it will also break sites for people that happen to be stuck on ckeditor4. Sure, bad idea, but ckeditor project still has 80k users.

    IMHO, either keep that or we ned to do it as 2.x

  • Pipeline finished with Success
    4 months ago
    Total: 224s
    #253207
  • Pipeline finished with Success
    4 months ago
    Total: 159s
    #253218
  • Status changed to Needs review 4 months ago
  • 🇦🇺Australia kim.pepper 🏄‍♂️🇦🇺Sydney, Australia

    Thanks @berdir I addressed your comment and reverted the removal of the CKEditor4 \Drupal\embed\EmbedCKEditorPluginBase, and deprecated it instead. I assume this is all we need to do?

  • Pipeline finished with Success
    4 months ago
    Total: 308s
    #253220
  • Status changed to Needs work 4 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Two more comments.

  • Pipeline finished with Success
    4 months ago
    Total: 152s
    #254445
  • Pipeline finished with Success
    4 months ago
    Total: 1107s
    #254449
  • 🇦🇺Australia kim.pepper 🏄‍♂️🇦🇺Sydney, Australia

    Re-added the legacy ckeditor 4 hooks.

    Left this as NW as I don't really have an answer for comment about the test change. Left as unresolved.

  • 🇺🇸United States emptyvoid

    Based on the code audit of 1.9 using Update Status automation. I updated the code with the new class signatures and the info file.

    Not sure if this patch is useful for anyone though..
    I tested it on Drupal 10.3.2

    Won't be testing it further until I get a Drupal 11 build running.

  • Pipeline finished with Success
    about 1 month ago
    Total: 155s
    #337711
  • Pipeline finished with Failed
    about 1 month ago
    Total: 172s
    #337729
  • Pipeline finished with Success
    about 1 month ago
    Total: 168s
    #338680
  • Status changed to Needs review about 1 month ago
  • 🇮🇳India ankitv18

    On path: admin/config/content/embed/button/add
    After adding embed button, below is the output we are getting.

  • 🇮🇳India vipin.mittal18 Greater Noida

    MR !24 is working fine on Drupal 11.

  • 🇮🇳India vipin.mittal18 Greater Noida

    Hello @dave,

    It would be greatly appreciated if you could find some time to release a Drupal 11 compatible version of embed so that the community can upgrade to the most recent version of Drupal. Thanks!

  • First commit to issue fork.
  • Pipeline finished with Success
    19 days ago
    Total: 198s
    #354383
  • How is drupal 11 coming along?

  • heddn Nicaragua

    Tests are passing and someone seems to have manually tested this. Can this be committed?

  • heddn Nicaragua

    Linking 📌 Automated Drupal 11 compatibility fixes for file_browser Active since file_browser depends on this landing first too.

Production build 0.71.5 2024