- π³πΏNew Zealand jweowu
The patch in #17 is working for some cases but not others.
It seems to me that the obvious solution to avoiding repeated rendering was already mentioned by mglaman back in #15:
add static caching for the build() output, so access builds the block, and calling build() reuses the cached output
Is there some reason why re-using a cache of the rendered block would be problematic? I'm very surprised something along those lines wasn't the original change made for this issue.
- Status changed to Needs review
about 1 year ago 9:06am 12 October 2023 - last update
about 1 year ago Composer require failure - π³πΏNew Zealand jweowu
#17 did not resolve the issue for me nor some other users.
This new patch implements the caching approach described in comment #26 above (and in #15) to deal with the performance concern raised in π Module causes double rendering of blocks just to check access Fixed , and restoring the
blockAccess()
method to fix the bugs described in this issue. - last update
about 1 year ago 9 pass - last update
about 1 year ago 9 pass - πΊπΈUnited States alison
I think we can close π Empty blocks get displayed Needs review as a duplicate of this issue (#3271218)?
And maybe add contrib credit here, for folks who contributed over there.
- Status changed to RTBC
11 months ago 10:59pm 30 January 2024 - πΊπΈUnited States alison
At the risk of causing confusion...... #27 fixed our issue of "if page.region_name" being "incorrectly" evaluated as true. We haven't used any of the twig workarounds, nor have we added/used the core patch on π± [meta] Themes improperly check renderable arrays when determining visibility Needs work .
Does that track with what folks expect this patch to do? (I'm very pleased haha, I was just rereading the issue summary today, and I wasn't sure if I lost track of what was meant to be addressed in this issue vs. the core issue.)
-------
Put another way...Page template excerpt -- "sidebar_primary" is a region that contains a menu block:
{% if page.sidebar_primary %} <div id="sidebar-top" class="secondary"> {{ page.sidebar_primary }} </div> {% endif %}
Without the patch (#27), the resulting markup is this:
<div id="sidebar-top" class="secondary"></div>
With #27, the div simply isn't there π And that's certainly what I was hoping for, but...
Does that fit with everyone's intentions/expectations? -- even without the twig filter workarounds?
- π³πΏNew Zealand jweowu
That's 100% the intention of the patch, yes. It solves the problem raised in π Module causes double rendering of blocks just to check access Fixed without the side-effect of causing the present issue (and in turn causing people to use twig-based workarounds); so what you're seeing is exactly what's intended.
- Status changed to Fixed
8 months ago 6:31pm 6 May 2024 - π¨π¦Canada joelpittet Vancouver
Thanks @jweowu for fixing the regression without too much changes. It seems like people are happy with this change and it will be in the next release
-
joelpittet β
committed a62aeea0 on 8.x-1.x authored by
jweowu β
Issue #3271218 by jastraat, ahebrank, renatog: Menu block renders when...
-
joelpittet β
committed a62aeea0 on 8.x-1.x authored by
jweowu β
Automatically closed - issue fixed for 2 weeks with no activity.