Drupal 11 compatibility fixes

Created on 13 December 2024, 4 months ago

Problem/Motivation

This patch aims to make TAC Lite compatible with Drupal 11. The modifications align with the recommendations provided by the Upgrade Status module, and now the module passes that analysis. Manual testing on Drupal 10 confirms that the form roles load correctly, new permissions can be assigned, existing ones can be modified, permissions can be rebuilt, and all locations protected by terms are functioning as expected.

Remaining tasks

  • Test the patch on a Drupal 11 installation.
  • Review to identify any additional necessary changes or bugs.
📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @wolfhowling
  • First commit to issue fork.
  • Merge request !12Drupal 11 compatibility. → (Open) created by kevinfunk
  • 🇺🇸United States kevinfunk

    Thank you @wolfhowling for creating the issue. The patch did not apply to 8.x-1.x-dev so I created the MR to address the following:

    FILE: web/modules/contrib/tac_lite/src/Form/SchemeForm.php

    STATUS LINE MESSAGE
    --------------------------------------------------------------------------------
    Fix now 37 Call to deprecated function user_roles(). Deprecated in
    drupal:10.2.0 and is removed from drupal:11.0.0. Use
    Drupal\user\Entity\Role::loadMultiple() and, if necessary,
    an inline implementation instead.
    --------------------------------------------------------------------------------

    FILE: web/modules/contrib/tac_lite/tac_lite.info.yml

    STATUS LINE MESSAGE
    --------------------------------------------------------------------------------
    Check manually 6 Value of core_version_requirement: ^8 || ^9 || ^10 is not
    compatible with the next major version of Drupal core. See
    https://drupal.org/node/3070687.
    --------------------------------------------------------------------------------

    FILE: web/modules/contrib/tac_lite/tac_lite_create/tac_lite_create.info.yml

    STATUS LINE MESSAGE
    --------------------------------------------------------------------------------
    Check manually 6 Value of core_version_requirement: ^8 || ^9 || ^10 is not
    compatible with the next major version of Drupal core. See
    https://drupal.org/node/3070687.
    --------------------------------------------------------------------------------

    I have also tested this on a Drupal 11 sites with the changes from the MR.

  • First commit to issue fork.
  • Merge request !13Drupal 11 compatibility → (Open) created by Unnamed author
  • 🇨🇦Canada bisonbleu

    MR !12 looks fine to me…?
    Doesn't MR !13 break backward compatibility to D8 and D9 ?

  • 🇮🇳India abhi_khandelwal Gandhinagar

    The #MR13 works for both Drupal 10 and Drupal 11. Attaching the upgrade status screenshot for reference. Moving the issue to RTBC.

  • 🇨🇦Canada bisonbleu

    @abhi_khandelwal, you are correct when you write:

    The #MR13 works for both Drupal 10 and Drupal 11.

    The green status in your capture means: «Compatible with next major Drupal core version». That's only when looking forward.

    But we also need to look backward. MR !13 will break past Drupal core versions i.e. Drupal 8.x and 9.x, because of it introduces a restriction: core_version_requirement: ^10 || ^11, and we don't want that.

    Here are examples of other modules that were recently changed to be D11 compatible without removing backward compatibility, if you look at he plain diff you'll see something like: core_version_requirement: ^8 || ^9 || ^10 || ^11

    And this is also exactly what you'll see in @kevinfunk MR !12 where backward compatibility to D8 and D9 is preserved.

  • Pipeline finished with Success
    3 months ago
    Total: 164s
    #379574
Production build 0.71.5 2024