Problem/Motivation
Would be great to have tests to ensure the module works as expected. Shouldn't be too hard, as the module is not that complicated. So I'll tag this as novice task.
The tests should include
- Create dummy content, like nodes or taxonomy terms
- Placing a block of this type for a certain menu
- Use the default block settings and ensure the results appear as expected
- Ensure the block is present and shows up as expected
- Adjust all settings one by one and ensure things go as expected
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | screenshot-2025-11-05 14_50_10.png | 34.61 KB | grevil |
Issue fork entity_submenu_block-3479961
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
faust74 commentedI haven’t written tests before, but I want to learn how to do so. I’ll give this task a try and keep you updated on my progress.
Comment #3
anybodyThank you @faust74! Looking very much forward to that! Feel free to ask here, if you should have any questions.
These snippets and tests from core may help, maybe!
Comment #4
miroslavstankov commentedI see this issue has been inactive for a while, and I’d like to start working on it.
Comment #6
miroslavstankov commentedAdd functional tests and config schema, migrate to PHP attributes
- Add functional tests covering all block settings and rendering scenarios
- Add config/schema/entity_submenu_block.schema.yml extending block.settings.system_menu_block:* with view_mode_* definitions for node, taxonomy_term, media, user block_content, comment, and contact_message entity types
- Migrate EntitySubmenuBlock to PHP 8 #[Block] attribute with ::class constant for deriver
Comment #7
grevil commentedComment #8
grevil commentedOk, this issue escalated a bit, but I removed the weird config workarounds in the Block and adjusted the settings structure.
The update hook works as expected:

Comment #9
grevil commentedComment #10
grevil commentedAll done, please review!
Comment #11
miroslavstankov commentedThank you for reviewing and fixing those things.
Comment #12
anybodyLeft one comment. LGTM otherwise, thank you!!
Comment #13
grevil commentedComment #14
anybodyComment #17
anybodySadly this caused a heavy regression on settings, see #3611349: Regression: Settings lost 1.8.0 => 1.9.0 using block_field