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

Created on 14 May 2012, about 12 years ago
Updated 4 October 2023, 9 months 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

Postponed

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 1 hour 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 9 months 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.)

Production build 0.69.0 2024