Deprecate FIELD_LOAD_* constants

Created on 4 September 2013, almost 12 years ago
Updated 7 August 2025, 16 days ago

- Those constants are used for "field loading" logic. This used to be part of a public API (field_attach_load() & friend), but this logic is now internal to the storage controllers, and there is no external facing API for those operations.
So the storage controllers using those constants is fine, but external code referring to them feels like messing with something you're not supposed to know.

- Even within storage controllers: the rest of the entity loading code rather uses a boolean $load_revision flag, and "translates" it to one of the constants when doing "field stuff":

protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
  $this->loadFieldItems($queried_entities, $load_revision ? FIELD_LOAD_REVISION : FIELD_LOAD_CURRENT);

Looks like two different systems talking to each other - which *was* the case, but is now a bit absurd within one single class / class hierarchy.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡«πŸ‡·France yched

Live updates comments and jobs are added and updated live.
  • API clean-up

    Refactors an existing API or subsystem for consistency, performance, modularization, flexibility, third-party integration, etc. May imply an API change. Frequently used during the Code Slush phase of the release cycle.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • 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!

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    #30 still stands today, the weirdness is that the constants are defined in core then used once in file.module and once in Views, but these uses could probably be swapped to self-contained constants in each of those cases; it doesn't make much sense to share them. Neither of the things in #30 has happened in the time since that was posted, though. Maybe we just make those issues, postpone this on them happening, and wait another ten years?

Production build 0.71.5 2024