Replace deprecated system_rebuild_module_data() with \Drupal::service('extension.list.module')

Created on 27 April 2023, over 1 year ago
Updated 8 February 2024, 10 months ago

Problem/Motivation

Error: Call to undefined function Drupal\cacheflush\Controller\system_rebuild_module_data() in Drupal\cacheflush\Controller\CacheflushApi->clearModuleCache() (line 187 of /var/www/html/web/modules/contrib/cacheflush/src/Controller/CacheflushApi.php).

Steps to reproduce

  1. Enable Ultimate Cron, Cacheflush, CacheFfush UI, Cacheflush Entity, and Cacheflush Cron modules
  2. Go to Structure ->Cacheflush ->Add new
  3. Fill out the form, making sure Cron checkbox is checked, and save. (may result in a separate unrelated error)
  4. Go to Ultimate Cron jobs page (/admin/config/system/cron/jobs)
  5. Run the new cron entity. Will result in an error message that system_rebuild_module_data() is undefined.

Proposed resolution

Replace deprecated system_rebuild_module_data() call with dependency injection of ModuleExtensionList and call to getList().

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States kelly.m.jacobs

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024