Automated Drupal 10 compatibility fixes

Created on 16 June 2022, about 2 years ago
Updated 16 November 2023, 7 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

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

Needs work

Version

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

  • Status changed to RTBC about 1 year ago
  • Applied the merge request in Drupal 9 and Drupal 10. Found no error in drupal check and upgrade status.
    It makes module compatible without error. Attached screenshot for reference.

    Moving to RTBC :)

    • 4c4d82a7 committed on issue/popoup_message-3289114
      Issue #3289114: Use DI instead of calling service statically.
      
    • 8fe99b2b committed on issue/popoup_message-3289114
      Issue #3289114: Remove obsolete empty line.
      
  • 🇧🇪Belgium LRoels Ghent

    After the changes in this last commit, the configuration page seems to be broken.
    Errors like the one below seem to point at this commit.

    TypeError: Drupal\popup_message\Form\PopupMessageSettingsForm::__construct(): Argument #1 ($cssOptimizer) must be of type Drupal\Core\Asset\CssCollectionOptimizerLazy, Drupal\Core\Asset\CssCollectionOptimizer given, called in /var/www/html/web/modules/contrib/popup_message/src/Form/PopupMessageSettingsForm.php on line 81 in Drupal\popup_message\Form\PopupMessageSettingsForm->__construct() (line 66 of modules/contrib/popup_message/src/Form/PopupMessageSettingsForm.php).

  • Status changed to Needs work about 1 year ago
    • 67bb1517 committed on issue/popoup_message-3289114
      Issue #3289114: resolve conflict.
      
    • 7a31f538 committed on issue/popoup_message-3289114
      Issue #3289114: Update modules's composer.json requirements.
      
    • 215e9b95 committed on issue/popoup_message-3289114
      Issue #3289114: Revert to use qualifier.
      
  • 🇵🇱Poland Marcin Dębicki Poland, Goleniów

    Hi LRoels , thank you for reporting this issue. It's been fixed. Release 2.0.2 contains this change.

  • 🇺🇸United States JackG102 Falls Church, VA

    I currently upgraded to the 2.0.2 release, cleared the cache, and I am getting the error marked in comment #14 when I go to the configuration page for the module. This is curious, because I am confirming that I am seeing CssCollectionOptimizerLazy name changes in the code in our codebase to confirm we pulled in the latest changes. Not sure, but wanted to drop in a comment that I am also having an issue. I will check to see if I have made an oversight somewhere.

  • 🇧🇪Belgium LRoels Ghent

    Hi, we also still get the error after updating to the 2.0.2 release.
    I think it has to do with the lazy class not existing untill 10.1 ( https://www.drupal.org/node/2888767 ).
    We are using D10.0.9. It seems best to keep using the CssCollectionOptimizer class because otherwise the module is not backwards compatible.

  • @lroels opened merge request.
  • 🇩🇪Germany macdev_drupal Wiesbaden

    Confirm - 2.0.2 is broken with 9.5.9 Drupal Core

  • 🇺🇸United States JackG102 Falls Church, VA

    First time patch maker :) - I have tentatively put a patch together that I think should work for folks who want to upgrade to 2.0.2 but are still on D9 or it seems prior to D10.1 according to LRoels and the docs linked to. It mainly takes off the "Lazy" parts in PopupMessageSettingsForm.php. I have tested applying it to my D9 project and now the configuration menu works well. To be clear, this patch should not be merged in, but a helpful bridge to help people upgrade the module but have it work on D9 prior to the D10 jump.

    Feel free to improve upon it and make it your own.

  • 🇵🇱Poland Marcin Dębicki Poland, Goleniów

    Version 2.0.3 released as compatible with Drupal 8 || 9. Drupal 10 compatibility released as 3.0.0 version.

  • 🇧🇷Brazil carolpettirossi Campinas - SP

    I'm wondering why can't we make the v3 compatible with D9?

    How do I upgrade from Drupal 9 to Drupal 10 if I have this module on v2?

  • 🇵🇱Poland Marcin Dębicki Poland, Goleniów

    Hi Carolpettirossi,

    we had to split versions due to breaking changes. CssCollectionOptimizer starting from Drupal 10.1 is deprecated in favor of CssCollectionOptimizerLazy and CssCollectionOptimizerLazy is not available for Drupal 9.

    When it comes to upgrade Drupal 9 to 10 you need to update module's version i composer.json or just run composer require drupal/popup_message after upgrade Drupal 9 to Drupal 10.

  • 🇮🇳India sakthi_dev

    Hi Carolpettirossi,

    You can use "drupal/popup_message":^2.0 || ^3.0 in composer.json while upgrading from D9 to D10. So, that we won't be getting any blockers.

  • 🇧🇷Brazil carolpettirossi Campinas - SP

    Thanks for the suggestion =)

  • 🇺🇸United States JackG102 Falls Church, VA

    I think with the release 3.0.0, there is now a stable Drupal 10 release. In addition to sakthi_dev's comment about how to upgrade from D9 to D10 with some simple composer syntax to either use 2.x or 3.x, this ticket can be closed now and have the status marked as "fixed"? I am not sure if a maintainer should do that or if it's deemed permissible for someone else to do?

Production build 0.69.0 2024