Decide if we need to load #type defaults for #pre_render callbacks

Created on 3 April 2025, 9 days ago

Problem/Motivation

Spin-off from 🐛 Lazy builder broken (#type defaults not loaded) Needs work .

For lazy_builder callbacks it made absolute sense to want to load defaults if the builder returned a render array with a #type key at the top level, because anything specifying a lazy_builder may not specify a type.

However, for pre_render callbacks, it's different. They may be called on something that already has a type and I'm not sure we should support type switching after another type's defaults have already been loaded. The only case where we might want to load the defaults is if a type wasn't set before.

Steps to reproduce

  1. Add a pre_render callback to an element without a #type
  2. Set the #type in the callback
  3. Witness that the type's defaults are not loaded

Proposed resolution

N/A

Remaining tasks

Discuss how we want to fix this: Only support elements that had no type before? Throw a warning when changing types? ...

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

📌 Task
Status

Active

Version

11.0 🔥

Component

render system

Created by

🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

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

Comments & Activities

Production build 0.71.5 2024