Automated Drupal 10 compatibility fixes

Created on 15 June 2022, over 2 years ago
Updated 24 February 2023, almost 2 years 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

1.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 almost 2 years ago
  • 🇺🇸United States mlncn Minneapolis, MN, USA

    Final patch looks good!

  • Status changed to Needs work almost 2 years ago
  • 🇨🇭Switzerland stefanos.petrakis@gmail.com Biel, Switzerland

    The final patch does not look that good since the tests for D10.1 failed (see #17).
    Working on this, hoping I can provide an updated patch with the tests fixed.

  • @stefanospetrakis opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇨🇭Switzerland stefanos.petrakis@gmail.com Biel, Switzerland

    Tests are green again, this is ready for a review now.

  • 🇨🇭Switzerland stefanos.petrakis@gmail.com Biel, Switzerland

    Seems like we too landed at the chicken-egg problem.

    In order to have the module be applicable as a patch (via cweagans/composer-patches) to released versions (e.g. 1.3.0), we need to drop any mods to composer.json or comment_notify.info.yml, regarding drupal core version requirements. This is the current state of the MR.

    This latest version however does not allow running the automated tests on D.O. and is still not installable on D10 unless combined with mglaman/composer-drupal-lenient (for composer installation) and Backward Compatibility ( https://www.drupal.org/project/backward_compatibility ) for enabling on Drupal.

    The previous version of the MR that was changing the info.yml file (as well as composer.json) could be used as a patch via git, namely by requesting the composer dependency as in:
    composer require drupal/comment_notify:1.3.0 --prefer-source
    After that, the module was fetched using git and the MR was applicable as a patch (via git apply patch) without hiccups.
    That version was allowing running tests on D.O.
    Attaching that version as a patch for reference.

  • 🇮🇳India yashingole

    I have reviewed and checked Patch #22 this works for drupal 9.5 and drupal 10.0. and 10.0.1
    Screenshots of the compatibility on 9.5 and the Config on 10 have been attached for reference:

  • Status changed to RTBC almost 2 years ago
  • Status changed to Needs review almost 2 years ago
  • 🇺🇸United States greggles Denver, Colorado, USA

    @KlemenDEV could you describe your review as you set to RTBC?

    I've done a brief review and am inclined to commit and fix things in followups, but would be good to confirm what QA steps have been done.

    @Stefanos Petrakis thanks for the work on the MR and patch! If you are interested in becoming a co-maintainer that could be a good idea :)

  • 🇨🇭Switzerland stefanos.petrakis@gmail.com Biel, Switzerland

    Hi @greggles; thanks for the kind words. I could imagine co-maintaining, sure!

  • Status changed to Needs work almost 2 years ago
  • 🇳🇱Netherlands daffie

    Most changes look good to me. I have 2 remarks about the patch:

    1. +++ b/tests/src/Functional/CommentNotifyNotificationsTest.php
      @@ -18,12 +18,23 @@ class CommentNotifyNotificationsTest extends CommentNotifyTestBase {
      +  /**
      +   * Exempt from strict schema checking.
      +   *
      +   * This is due to saving configuration with a missing schema for terms.
      +   *
      +   * @see \Drupal\Core\Config\Development\ConfigSchemaChecker
      +   *
      +   * @var bool
      +   */
      +  protected $strictConfigSchema = FALSE;
      

      This change looks wrong to me. Lets just add the config schema.

    2. +++ b/comment_notify.info.yml
      @@ -6,4 +6,4 @@ dependencies:
      -core_version_requirement: ^8 || ^9
      +core_version_requirement: ">=8"
      
      +++ b/composer.json
      @@ -23,7 +23,6 @@
      -        "drupal/core": "^8 || ^9",
      

      I am not happy with this change. It is now implying that this version will work with all future version of Drupal core. Only we have now idea what changes will be in future versions of Drupal core.

  • 🇸🇮Slovenia KlemenDEV

    @KlemenDEV could you describe your review as you set to RTBC?

    I have marked it based on the 10.0.1 testing of @yashingole and I myself patched the module on the 9.5.3 website, verified configuration (site-wide and user form) still worked, and left some comments (two different comment types), and made sure the email was sent properly. Also, no errors or warnings were logged by the PHP (8.1.11).

  • Status changed to Needs review almost 2 years ago
  • 🇨🇭Switzerland stefanos.petrakis@gmail.com Biel, Switzerland

    Back to NR after responding to @daffie 's comment in #27 (thanks for the extra eyes!)

  • Status changed to RTBC almost 2 years ago
  • 🇳🇱Netherlands daffie

    It looks good to me.
    All my remarks have been addressed.

  • Status changed to Fixed almost 2 years ago
  • 🇺🇸United States greggles Denver, Colorado, USA

    @KlemenDEV thanks for comment in #28. I appreciate that extra detail.

    @stefanos.petrakis and @daffie thanks for the extra review and changes! I've now merged it so I think this issue can be marked as fixed.

  • 🇺🇸United States greggles Denver, Colorado, USA

    I filed 📌 New release, new co-maintainer Fixed about new comaintainer and new release. Thanks!

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

Production build 0.71.5 2024