Problem/Motivation
The admin theme library, varbase_layout_builder/claro10 in our case, is not attached to layout builder route of entity types other than node (commerce_product in our case).
The library will be attached to layout_builder_add_block, layout_builder_update_block, media_image_edit_form forms, but this will mess up the CSS rules specificity. This is because when the library is not already attached to layout builder route, the files in varbase_layout_builder/claro10 will be loaded after varbase_layout_builder/enhancements taking higher precedence and therefore breaking some styling.
Example
Before fix:

After fix:

Steps to reproduce
With Varbase: 9.1.2 and Drupal: 10.2.6
Enable layout builder for any entity type other than node.
Visit the layout builder route and observe the inconsistency between node's layout builder styling and the other entity type's layout builder styling.
Proposed resolution
Instead of matching layout_builder.overrides.node.view route to attach the library, use regex to match all entity types.
Remaining tasks
- ✅ File an issue about this project
- ✅ Addition/Change/Update/Fix to this project
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Update Release Notes and Update Helper on new feature change/addition
- ✅ Release varbase-10.0.0, varbase_layout_builder-10.1.0, varbase-9.1.4, varbase_layout_builder-10.0.54
Varbase update type
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Issue #3447559 by Redwan Jamous: Fixed admin theme library not attached for entity types other than node
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3447559-2.patch | 685 bytes | redwan jamous |
Issue fork varbase_layout_builder-3447559
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 #3
redwan jamous commentedAdding a patch file to use with composer...
Comment #4
rajab natshahvarbase_layout_builder/claro10is in the VLB 10.0.x branch for Varbase 9Do we need this fix in VLB 10.1.x branch for Varbase 10 too?
Comment #5
rajab natshahComment #6
redwan jamous commented@Rajab Natshah, yes we do as this is not specifically related to
varbase_layout_builder/claro10and the same issue will happen with any admin theme.Comment #7
rajab natshahGot that, Thanks for clearing that out.
Let us do 2 branches and 2 MRs
one for
10.0.xand one for10.1.xComment #9
redwan jamous commentedThank you, Rajab!
I cherry-picked the commit into a new branch and opened a new PR for
10.0.x, leaving the old one for10.1.x.Comment #10
rajab natshahThank you, Redwan, for following up and the MRs!
Had a testing round for latest Varbase 9.1.x and Varbase 10.0.x released changes and fixes.
I'm not able to reproduce the issue
Tested with Taxonomies, Block types, and Mini Layouts custom entity type .
Even tho, it feels logical to switch to your logic on
preg_match('/^layout_builder\.overrides\.[a-z0-9_]+\.view$/', $url_object->getRouteName())Comment #13
rajab natshahComment #14
rajab natshahComment #15
rajab natshah✅ Released varbase_layout_builder-10.0.54
Comment #16
rajab natshah✅ Released varbase_layout_builder-10.1.0
Comment #18
rajab natshah✅ Release varbase-10.0.0
Comment #19
rajab natshah--