Drupal 10 compatibility fixes

Created on 25 December 2023, 11 months ago
Updated 6 September 2024, 2 months ago

The current version of the module is not Drupal 10 compatible, and we need to apply automated fixes to ensure smooth integration with Drupal 10. This issue aims to address the compatibility issues and update the module for the upcoming Drupal 10 release.

📌 Task
Status

Needs review

Version

9.3

Component

Code

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

Merge Requests

Comments & Activities

  • Issue created by @Haris Khan Jadoon
  • Status changed to Active 11 months ago
  • Status changed to Needs review 11 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India Sandeep_k New Delhi

    Verified and tested patch drupal_10_compatibility_fixes.patch on Drupal version- 10.2.1-dev. The patch was applied successfully and looks good to me.

    Testing Steps:

    Add/download Module in Drupal 10.
    Go to Extent> You can see the compatibility error.
    Download this patch and Apply.
    Go back to the Extent module and re-verify this.
    Testing Results:
    After applying the patch, the compatibility error was removed & I was able to install this module on the drupal-10.2 version.

    Moving this ticket to RTBC.

  • Status changed to RTBC 11 months ago
  • Status changed to Needs work 11 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
     core: 8.x
    +core_version_requirement: ^8 || ^9 || ^10

    Those lines cannot be used together.
    core_version_requirement must be core_version_requirement: ^8.8 || ^9 || ^10 and core: 8.x must be removed.

    I did not check the code is really compatible with Drupal 10, which means that change could not be sufficient.

  • First commit to issue fork.
  • Merge request !1Issue #3410774: D10 compatibility. → (Open) created by ankithashetty
  • Status changed to Needs review 11 months ago
  • I have Update the patch the issue has been resolved

  • 🇮🇳India ankithashetty Karnataka, India

    Raised an MR with D10 compatibility fixes.

    Resolved the below errors reported by upgrade status:

    web/modules/contrib/toolbar_anti_flicker/toolbar_anti_flicker.module	125	Call to deprecated function drupal_get_path(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.
    
    web/modules/contrib/toolbar_anti_flicker/toolbar_anti_flicker.libraries.yml	0	The 'toolbar-anti-flicker' library is depending on a deprecated library. The core/jquery.cookie asset library is deprecated in Drupal 9.0.0 and will be removed in Drupal 10.0.0. Use the core/js-cookie library instead. See https://www.drupal.org/node/3104677
    
    web/modules/contrib/toolbar_anti_flicker/toolbar_anti_flicker.info.yml	0	Value of core_version_requirement: ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687.

    Thanks!

  • Status changed to Needs work 11 months ago
  • 🇭🇰Hong Kong droplet

    I believe there is something more than just updating the version number.

  • Status changed to Needs review 11 months ago
  • 🇮🇳India ankithashetty Karnataka, India

    Yes, @droplet.
    As shared above, to make the module D10 compatible, we generally check the results from the upgrade status ( https://www.drupal.org/project/upgrade_status )

    Error reported:

    web/modules/contrib/toolbar_anti_flicker/toolbar_anti_flicker.module	125	Call to deprecated function drupal_get_path(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.
    
    web/modules/contrib/toolbar_anti_flicker/toolbar_anti_flicker.libraries.yml	0	The 'toolbar-anti-flicker' library is depending on a deprecated library. The core/jquery.cookie asset library is deprecated in Drupal 9.0.0 and will be removed in Drupal 10.0.0. Use the core/js-cookie library instead. See https://www.drupal.org/node/3104677
    
    web/modules/contrib/toolbar_anti_flicker/toolbar_anti_flicker.info.yml	0	Value of core_version_requirement: ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687.

    Here,

    1. we replaced the deprecated function drupal_get_path() with \Drupal::service('extension.list.module')->getPath('toolbar_anti_flicker')
    2. core/jquery.cookie asset library is removed in Drupal 10.0.0. Now, to make it work with core D10, we must replace it with core/js-cookie library
    3. Updated core_version_requirement key to support D10
    4. Added a composer.json file to include D10 compatibility. (Please note: IF this file is not needed, we can remove it from MR. The above changes seems necessary. Please suggest, will make relevant changes.)

    Thank you!

  • Issue was unassigned.
  • The issues has been resolved as you @ankithashetty mention in the above comment you can see this as well...

  • This patch will fix all issue ......

  • Status changed to RTBC 11 months ago
  • Status changed to Needs review 10 months ago
  • Status changed to RTBC 10 months ago
  • Status changed to Needs review 10 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to RTBC 10 months ago
  • Status changed to Needs work 10 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -      '#title' => t(' '),
    +      '#title' => (' '),
           '#url' => Url::fromRoute('<front>'),
         ],
         'tray' => [
    -      '#heading' => t('&nbsp;'),
    +      '#heading' => ('&nbsp;'),

    Those are not correct changes. If the patch is supposed to be used instead of the MR, that needs to be fixed.
    It is not clear why the patch changes less files than the MR, though.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • First commit to issue fork.
  • Status changed to Needs review 10 months ago
  • 🇮🇳India viren18febS

    I have replaced the deprecated function from #13 in same MR, please review.

  • Status changed to RTBC 10 months ago
  • Status changed to Fixed 7 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇧🇪Belgium Frederikvho Belgium

    Hello,

    Why was this issue closed? The merge request is still open.

    Also, is this contrib module still needed as core made some changes to the toolbar flickering? I wasn't able to reproduce the flickering myself at first glances.

    See Drupal 10.1.0 introduced new inline JavaScript in the toolbar module to prevent flickering .

  • Status changed to RTBC 2 months ago
  • Status changed to Needs review 2 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024