Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292538

theme_status_report() is severely broken

$
0
0

In system_theme() we see that theme_status_report() takes a render element. But in fact all callers pass an array that is not compatible with drupal_render(), which the theme function seems to try to work around. It fails in real life cases though, which we have now in #2009688: Replace theme() with drupal_render() in update module and #2009674: Replace theme() with drupal_render() in system module. Note that the issue is not triggered by the use of drupal_render(). Passing in any real life render element directly into the theme function will wreak havoc. Adding a #theme property is enough to make it fail.
#2030805: Make theme_status_report compatible with drupal_render() tries to fix this by improving the workarounds in theme_status_report(). But perhaps this function was never really meant to take a render element? It was declared as such in #600974: theme() fails for theme functions taking one argument in renderable arrays where it was needed to explicitely set variables/ render element for existing theme hooks. See also #572618: All theme functions should take a single argument to make preprocess sane and meaningful.
I don't have an explanation right now why the code is explicitely excluding keys with an not empty #type property. Could not find where this was added. Could not find calling code that passes anything else than straight arrays coming from hook_requirements().


Viewing all articles
Browse latest Browse all 292538

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>