Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 25 October 2023, about 1 year 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

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches 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 "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

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, Needs work or Reviewed and tested by the community) 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.

    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 patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  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 then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). 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, Needs work and Reviewed and tested by the community) 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 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.

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 Project analysis issue queue .

📌 Task
Status

Fixed

Version

5.0

Component

Code

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

Comments & Activities

Not all content is available!

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

  • 🇨🇦Canada _randy

    Tested #2, #4 and #6 on D10.0.3 and so far it runs well. No new issues to report.

  • 🇮🇳India Hemangi Gokhale

    D10 compatibility was missing on this file /tests/themes/responsive_menu_theme_test_nobp/responsive_menu_theme_test_nobp.info.yml. I have added it and have consolidated all the patches into one patch.

  • Status changed to RTBC over 1 year ago
  • I tested patch #8 on latest 10.0.7 drupal version which is applied cleanly and working as expected..module showing compatible in upgrade_status and also there are false positive issues in drupal-check which are ignorable...so making it RTBC for latest D10 release..

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States dww

    Thanks for working on this! However, this can't possibly be RTBC if the testbot is failing. We need to see passing green tests before this could be committed.

    Cheers,
    -Derek

  • Status changed to Needs review over 1 year ago
  • Upadated patch #8 for passing the test kindly review..

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Build Successful
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Build Successful
  • 🇮🇹Italy tanc Italy

    Thanks for these patches and your time! It looks like the tests are failing on the polyfills inclusion. I wonder whether with release 5.x we can drop IE support? Considering Drupal 10 doesn't support IE I think it's safe to remove it. It will mean removing the test, the form item and the config.

  • 🇬🇧United Kingdom jprj

    Thanks for the patch. Have tried it on a site migrated to D10 and it behaves as I expected.

  • Status changed to RTBC over 1 year ago
  • 🇩🇪Germany dbielke1986

    The patch is also working for me - so we can mark this as RTBC.

    Is there a chance to push the changes to a new release? We need to update our page to D10 and this module is one which is incompatible to D10.

  • 🇮🇳India soumyajit40cs

    {
    "name": "drupal/responsive_menu",
    "version": "4.4.2",
    "source": {
    "type": "git",
    "url": "https://git.drupalcode.org/project/responsive_menu.git",
    "reference": "4.4.2"
    },
    "dist": {
    "type": "zip",
    "url": "https://ftp.drupal.org/files/projects/responsive_menu-4.4.2.zip",
    "reference": "4.4.2",
    "shasum": "26d13cc0fa3bbaf4a4a83f0012095e01cbcc5272"
    },
    "require": {
    "drupal/core": "^8 || ^9"
    },

    I have applied the patch to D10 compatibility issue. When I checked the composer.lock file noticed that still it required Drupal core 8/9. That's why when I am trying to update drupal core it's failed.

  • Status changed to Needs work over 1 year ago
  • 🇬🇧United Kingdom dreamleaf

    I can also confirm the combined patch in #16 is working, this is a really great module and one of my only blockers to updating some sites to D10.

    Any chance of getting a working release out with the patch rolled in please? If there are sub issues (such as the IE polyfill stuff) can these get put as active issues so people can help out and get this module fully kick ass.

  • 🇫🇮Finland heikkiy Oulu

    Could we also create a fork of the current 4.4.x and 5.x branches with the changes? It's not possible to install the module with Composer with a patch but it is required to use a fork. So it would be more easy to test the module with Drupal 10 if we had a fork with the changes.

  • 🇺🇸United States mortona2k Seattle

    I also vote for updating the dev branches, but here's how I've worked around that.

    Clone the project repo into modules/pinned. Download and apply patches in that directory, or check out the issue fork you want to use. Maybe add a readme that describes the patches or the commit you used.

    If the module has composer dependencies, set it up as a custom module in composer so they are picked up with composer install.

    Git is weird about checking in other git repos, and I don't totally understand it. Dev modules installed with composer will include the git repo but git warns you when you add it. I have been deleting dev repos with [find -name .git -exec rm -rf {} \;], but DO NOT RUN THAT IN YOUR ROOT DIR!!! If anyone has insight on a better workflow, I'd love to hear it.

    Composer updates will clone the dev repos again, so I have to repeat this often. However, it won't touch ones in modules/pinned, since they aren't installed via composer.

    If I have to work on the pinned module again, I add the project repo or issue branch as a remote. [git init; git add .; git commit -m "Initial commit"; git remote add origin PROJECT_REPO; git checkout BRANCH --force; git clean -fd . (to clean up stray files like INSTALL.md)].

    Now you have the latest changes from the branch you want, with your previous version saved in a commit. Depending on what you want to do, you could reapply the patches, or add more issue branch remotes and merge those branches in.

    If you follow these steps, don't add the module with composer or else you'll get a duplicate and confuse Drupal. To go back, delete the pinned module and install the project with composer again. If Drupal is still looking in the old dir, you have to hack the database, I think to truncate one of the cache tables. If you can disable the module first, that saves some trouble, but is not always possible.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Build Successful
  • @heikkiy opened merge request.
  • 🇫🇮Finland heikkiy Oulu

    @mortona24k The above flow doesn't at least for us work because we use automated deployments and we need to be able to install the module with Composer completely.

    I now created a new issue fork from this issue and applied the patch #12 to it.

    I was able to install the patch and it seems like our menu is working again. I need to do more testing that our all styles still work but at least I was able to now get rid of the deprecated jquery.once errors.

    To install the merge request in your project with composer you can follow this guide .

    In your composer repositories add this:

    {
      "type": "git",
      "url": "https://git.drupalcode.org/issue/responsive_menu-3297964.git"
    },
    

    Then under normal Composer repository for Drupal add the module as excluded:

    {
      "type": "composer",
      "url": "https://packages.drupal.org/8",
      "exclude": [
        "drupal/responsive_menu",
        ]
    },
    

    And finally you can install the forked version with Composer:

    composer require "drupal/responsive_menu:dev-3297964-automated-drupal-10-compatibility-fixes"
    

    This should install the merge branch with all the Drupal 10 fixes applied.

  • Status changed to RTBC about 1 year ago
  • 🇬🇧United Kingdom stephen-cox

    We have the changes on the issues fork https://git.drupalcode.org/issue/responsive_menu-3297964/-/tree/3297964-... are working on a number of sites without issue.

    Would be great if we can get a dev release with this at a minimum so we don't have to keep using the issue fork to install it.

  • 🇫🇷France devil2005

    Hi,

    +1 with #27

    Thanks a lot

  • Status changed to Fixed about 1 year ago
  • 🇬🇧United Kingdom stephen-cox

    I've merged this into the 5.0.x branch and created a 5.0.0-alpha1 release with Drupal 10 support.

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

Production build 0.71.5 2024