- 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium
Closing in favor of 🐛 Lazy builder broken (#type defaults not loaded) Needs work as the core team explained there that they do consider this a DX bug they want to see fixed.
Lazy builders can't return a single element with a #type property, because of 🐛 Lazy builder broken (#type defaults not loaded) Needs work .
This is documented at https://www.drupal.org/docs/8/api/render-api/auto-placeholdering → , but I've been bitten by it twice.
When you do return a single element with a #type property, the lazy builder output is simply not shown and there's no explanation.
Return a single element from a lazy builder callback that uses a #type.
Throw an exception in Renderer::doRender() to explain what's going wrong:
if (isset($new_elements['#type'])) {
throw new \LogicException('The result of a #lazy_builder callback may not be a #type element. Wrap a #type element in an array as a child. See https://www.drupal.org/project/drupal/issues/2609250.');
}
Are there some values of #type that DO currently work, and whose behaviour should be preserved? I don't understand what '#type defaults not loaded' means on that other issue.
None
None
None
Closed: duplicate
11.0 🔥
render system
Enhances developer experience.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Closing in favor of 🐛 Lazy builder broken (#type defaults not loaded) Needs work as the core team explained there that they do consider this a DX bug they want to see fixed.