0

I created a custom block module (nothing fancy, just an A-Z list and a taxonomy list for navigation), this worked fine in D8 & D9, now since upgrading to D10 it only shows when logged out, when logged in, it still writes a debug message to the Apache errorlog from the build() function, so I know the code is being called and I can dump the content to the log, I just get no display of the output. I have a few paths including . Log out and the block is displayed again.

All the answers I can find are for the block not displaying and requiring a login, this works fine until I login.

I'm outputting to the "hero" region and the region is displaying OK, just without my block content.

Any suggestions on what to look for?

6
  • Yes, all good, but surely if it was incompatible, it would fail regardless of logon? Commented Jul 4, 2023 at 12:46
  • Could be caching with your theme. Try with one of the unmodified core themes and see if you can reproduce the issue. Commented Jul 4, 2023 at 12:58
  • Does the block have caching metadata? It’s not absolutely required: I’m just asking. Perhaps you should show the code.
    – mona lisa
    Commented Jul 4, 2023 at 13:47
  • main element of build is $build = [ '#theme' => 'hopnavigation_block', '#commons' => $commons_menu, '#lords' => $lords_menu, '#az' => $az, '#constituency' => $con_az, ]; return $build; public function getCacheMaxAge(): int { return 0; } Commented Jul 4, 2023 at 14:06
  • Please put code samples in the Question. It's difficult to format code in comments, and the Question should contain everything necessary for a fact-based answer.
    – mona lisa
    Commented Jul 4, 2023 at 16:32

1 Answer 1

0

Not entirely an answer, but I put the same block into claro theme and all was good, the theme in use was a temporary testing theme so will create new one via starterkit so issue is resolved, even if the actual question was not answered. Testing theme was a clone of Olivero taken from 9.4 using the work at https://github.com/mherchel/olivero-subtheme if that helps others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.