This is part of #2046881: [meta] Avoid "early rendered" strings where beneficial to do so, build structured data to pass to drupal_render() once instead.
The whole update_results_page() function concatenates a giant string, including a call to drupal_render() before returning the big string.
This concatenation includes markup that could be represented with #theme 'item_list', #theme_wrappers 'container'...
Once it's built up, the string is returned. The only place this function is called is in update.php, which calls drupal_render() on the maintenance page.
The maintenance page contains {{ content }} (which contains $output).
We don't need update_results_page() to be an early render, it could simply return structured data.
Comments
Comment #1
thedavidmeister CreditAttribution: thedavidmeister commentedpostponed on #2072647: #theme 'maintenance_page' should support render arrays in #content.
Comment #2
thedavidmeister CreditAttribution: thedavidmeister commentedno longer blocked.
Comment #3
george.echim CreditAttribution: george.echim commentedI tried to refactor the update_results_page() function but I don't find any information about how Drupal 8 is handling the ?q= type of url if Clean Urls are not supported.
I found an issue here
Comment #4
thedavidmeister CreditAttribution: thedavidmeister commentedThe purpose of this issue is not to broadly refactor this function.
Very specifically we want to convert string concatenation that looks like this:
To things that look more like this:
But we don't want to change any logic, just the way strings are built from data.
Comment #5
andypostThe code now exactly like was proposed