[META] Remove all usages of drupal_static() & drupal_static_reset()

Created on 14 May 2012, over 12 years ago
Updated 4 April 2023, over 1 year ago

Problem/Motivation

In #2260187: [PP-1] Deprecate drupal_static() and drupal_static_reset() we'll deprecate the drupal_static() & drupal_static_reset() procedural functions. However, in order to do so, we have to remove first all usages from Drupal core.

Proposed resolution

We cannot do all the removals in one step. Each usage it's an issue itself. So, this issues is a META to track the progress:

Child issues:

Done:

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Original report

from comment #19 of #1567428: Active trail tests , in order to handle static variables in Drupal 8 we should convert every use of statics to instead be protected properties of proper objects. The result of this effort will be that we properly register objects into the Dependency Injection Container and perhaps do away with drupal_static() and drupal_static_reset().

🌱 Plan
Status

Active

Version

10.1

Component
Base 

Last updated about 12 hours ago

Created by

🇺🇸United States cosmicdreams Minneapolis/St. Paul

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom catch
  • 🇳🇿New Zealand jweowu

    I agree with waiting until there is a standard replacement for drupal_static() which provides equivalent functionality and can be easily employed to replace the original API calls.

    I'm really startled to observe that a lot of commits have been made replacing drupal_static() with plain PHP static! To my mind that is counter-productive and achieves nothing more than the removal of useful functionality.

    I think those commits ought to be revisited once a new API is available so that they can be refitted with the new standard.

  • Status changed to Postponed about 1 year ago
  • 🇳🇿New Zealand jweowu

    Per #86, setting this to Postponed pending 🌱 [policy] Standardize how we implement in-memory caches Needs work .

    (And once that is resolved, the previous changes made for this issue ought to be reviewed.)

  • 🇺🇸United States nicxvan
Production build 0.71.5 2024