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

Created on 27 April 2023, over 2 years 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

Active

Version

1.0

Component

Code

Created by

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

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024