State class should be a series of traits

Created on 3 June 2015, about 10 years ago
Updated 23 June 2025, about 12 hours ago

Problem/Motivation

The State class contains a whole lot of code that has nothing to do with state, just with wrapping a KeyValue collection. That shouldn't be in the State class. It should be in a trait.

That may actually be 2 traits, one that handles the static cache logic, too. That way, it becomes much much easier for people to build their own wrapper classes around KeyValue collections.

Proposed resolution

Refactor the State class into one or more traits, likely reducing State itself to just a few lines of code.

Remaining tasks

Do it.

User interface changes

None.

API changes

None. It becomes easier to use the KeyValue system, but there should be no change to the State service itself.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡ΊπŸ‡ΈUnited States Crell

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

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 States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024