Add additional hook into field_attach_load that won't get cached

Created on 7 August 2013, over 11 years ago
Updated 6 February 2025, 17 days ago

If I have a custom field and I need to alter it's content on load(not display) I have three options I can use within field_attach_load:

  • hook_field_storage_pre_load()
  • hook_field_storage_load()
  • field-type module's hook_field_load()
  • hook_field_attach_load()

which gives me a good options BUT! after all has been done, the resulted data gets cached. I understand the approach, but In few situations I really could use an option to not cache the field's data.

So I propose another hook(hook_field_attach_load_uncached) that would be placed at the end of the field_attach_load function and could alter the data on the fly. Sure, it's only for those who know what they're doing but since the only way around current situation is to use hook_entity_load and scan for fields to alter, this is much better and more Drupal way to do it.

Since this design is still present in Drupal 8 I'm assigning this to D8 version and I hope it gets backported(if implemented).

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

field system

Created by

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

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. 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!

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    We have hook_entity_load() and hook_entity_storage_load(), the first is not cached.

Production build 0.71.5 2024