Autoloading hooks in address.views.inc is deprecated

Created on 14 March 2025, 3 months ago

Problem/Motivation

The Scheduler module implements a plugin for Commerce Products, and to test it we need to require Commerce, which also therefore requires Address. Tests at Core 11.2 are failing with

Autoloading hooks in the file (modules/contrib/address/address.views.inc) is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0.
Move the functions in this file to either the .module file or other appropriate location.
See https://www.drupal.org/node/3489765

Includes for hook_hook_info implementations have been deprecated
See https://www.drupal.org/node/3489765

I am not sure if this has been fixed in 2.1.x because I do not have read-access to view your pipeline job logs. The Scheduler tests use Address 2.0.3 so there may well have been work done since that release.

Proposed resolution

Remaining tasks

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom jonathan1055

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

Merge Requests

Comments & Activities

  • Issue created by @jonathan1055
  • 🇮🇳India sorabh.v6 Indore

    Working on it.

  • Pipeline finished with Success
    3 months ago
    Total: 367s
    #452487
  • 🇬🇧United Kingdom jonathan1055

    Thanks for working on this. I will try to see if I can use this MR issue branch in Scheduler's pipeline, so test the changes. It might be tricky to do. So I may apply a patch from here within the job.

  • 🇮🇳India sorabh.v6 Indore

    Thanks and please post your reviews here. Help us close this issue. :)

  • 🇬🇧United Kingdom jonathan1055

    I found a simple way to test this MR within the Scheduler pipeline, getting the file directly from here. I add the following custom before_script

    phpunit:
      before_script:
        # Test address module MR69 from https://www.drupal.org/project/address/issues/3512975
        - cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/contrib/address
        - curl https://git.drupalcode.org/project/address/-/merge_requests/69.diff | patch -p1 --verbose
        - ls -l address.*
        - head -15 < address.module
    

    This is the bit where the file is patched

    The test at Drupal 11.1 (current) passed, and the test at 11.2 (next minor) now has no deprecation warnings for Address. It does have plenty of warnings for other modules, so I have raised Scheduler issue 📌 Autoloading hooks in the file tokens.inc is deprecated D11.2 Active to track all of them.

    So from my point of view (only considering Scheduler testing) you have fixed the problem. Thank you for woking on this. Depending on when you merge, I may continue to use that patch, or try to get Address 2.x-dev when you commit it.

  • 🇮🇳India sorabh.v6 Indore

    Thanks for your reply. Maintainers of the module will be able to merge it.

  • Status changed to Needs review 12 days ago
  • 🇬🇧United Kingdom jonathan1055

    Thanks. This looks RTBC to me, but it is not good form to RTBC one's own MR, so if someone else could do that it would be great.

  • 🇺🇸United States dww

    We don't tend to "chase HEAD" like this. This is a brand new deprecation in 11.2 (not yet released) to prepare for D12 porting. It's going to be quite a while before we care about this deprecation. 😅

  • 🇬🇧United Kingdom jonathan1055

    OK, I understand that. It was a simple change, that's why I opened the issue.

    The reason was that Scheduler tests at 'next minor' have so many deprecations from Address (and other modules) that the log length exceeds the Gitlab limit, and is terminated short of the end. I guess I need to find a way to silence these deprecations, otherwise the log obscures any real test failures and other deprecations.

Production build 0.71.5 2024