Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This results in:
drupal_render($element['foo']);
drupal_render_children($element);
printing the 'foo' element twice if it's retrieved from cache.
Attached patch fixes it.
Comment | File | Size | Author |
---|---|---|---|
drupal_render-cache-printed.patch | 423 bytes | effulgentsia | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentednice catch.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedcould i just ask then why the forum blocks don't print twice when retrieved from cache? those use render cache system. in fact d8 uses render cache system for block cache as well now.
Comment #3
effulgentsia CreditAttribution: effulgentsia commentedBecause bartik's page.tpl.php doesn't print isolated blocks. However, if you change
print render($page['sidebar_first']);
toprint render($page['sidebar_first']['user_new']); print render($page['sidebar_first']);
, and enable the new user block in the first sidebar, and login as someone other than uid 1 (since block caching is disabled for the root user), then the first page you see after login only shows the new user block once (since the block isn't cached), but if you refresh that page, then the block shows twice with HEAD, and once with the patch.Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedMakes sense. Back to RTBC.
Comment #5
chx CreditAttribution: chx commentedsigh
Comment #6
jhedstromIf this is still an issue in 8.x (I couldn't readily tell if it is or not), it needs an IS update. Otherwise can be bumped back to 7.x.
Comment #18
quietone CreditAttribution: quietone at PreviousNext commentedThis was a bugsmash group triage issue. It was discussed with larowlan, lendude and myself.
There has been no discussion here for 7 years. The function drupal_render was removed early in the development of 8.0, replaced with Drupal\Core\Render\Renderer::renderRoot. The two are very different now.
There are steps to reproduce in #3 but they are for old php_templates, so no longer applicable.
Therefore, we agreed that we more information, specifically, does this problem still exist?
Since we need more information to move forward with this issue, I am setting the status to 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!
Comment #20
quietone CreditAttribution: quietone at PreviousNext commentedThere has been no further information to confirm that that is still an issue.
If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!