Blocks are hidden (at least in paragraphs) in rc2 and later

Created on 4 March 2024, 7 months ago

Problem/Motivation

About 3 years ago, I've added this comment #3216147-7: RC2 breaks usage in paragraphs to a similar problem, because on a specific project, all my block fields disappeared in the frontend after updating to rc2 (from rc1). We were only using Views blocks there, haven't investigated any other. The concerning project wasn't really maintained over the time, so I left it with rc1 since then. And I've never experienced the same problem again in any other project, although the setup is quite similar to a couple of other websites we have developed. Today I started updating that website. Currently it's still D9, but core and any contrib module was updated to the highest possible version in D9 so far (D10 upgrade will follow soon). The problem still exists, in production as well in two different local dev environments.

One thing I know for sure, is that adding the pre_render callback in #2855069: Add pre_render to BlockFieldFormatter causes the problem here, but I really do not have any clue, why this just happens for this website. One module we are using here, that we do not use frequently, is layout_paragraphs - but I have already tried uninstalling it, but the problem's still there. I haven't seen any suspicious custom code + anything we do here, we also do in lots of other projects.

It's quite hard to debug, because I haven't found the exact place, where the rendering for the block field stops. What I've seen is, that the #pre_render callback never gets called for the concerning fields. So it looks like that there must be an empty check somewhere in a hook that I cannot find :(

I've patched the module, adding a line to the render array in viewElements():

'content' => ' ',

Because there's a space as content set, the #pre_render callback gets called and the field gets correctly rendered in the frontend.

I can live with that workaround quite good, but if someone help me out of the dark to find a better solution, I'll appreicate it. The main reason for adding this issue is to help others trapping into the same problem. I wouldn't wonder if I'm not the only one....

Steps to reproduce

Absolutely no idea :D

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇹Austria agoradesign

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024