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:
Before fix

After 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
Command icon 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

Redwan Jamous created an issue. See original summary.

redwan jamous’s picture

Assigned: redwan jamous » Unassigned
Status: Active » Needs review
StatusFileSize
new685 bytes

Adding a patch file to use with composer...

rajab natshah’s picture

varbase_layout_builder/claro10 is in the VLB 10.0.x branch for Varbase 9
Do we need this fix in VLB 10.1.x branch for Varbase 10 too?

rajab natshah’s picture

Version: 10.1.x-dev » 10.0.x-dev
redwan jamous’s picture

@Rajab Natshah, yes we do as this is not specifically related to varbase_layout_builder/claro10 and the same issue will happen with any admin theme.

rajab natshah’s picture

Got that, Thanks for clearing that out.

Let us do 2 branches and 2 MRs
one for 10.0.x and one for 10.1.x

redwan jamous’s picture

Thank you, Rajab!
I cherry-picked the commit into a new branch and opened a new PR for 10.0.x, leaving the old one for 10.1.x.

rajab natshah’s picture

Assigned: Unassigned » rajab natshah

Thank 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

Enable layout builder for any entity type other than node

Tested with Taxonomies, Block types, and Mini Layouts custom entity type .

  • Which version of VLB you are using?
  • Is issue with a custom coded entity types?
  • Do you have a custom styling for it in the project?

Even tho, it feels logical to switch to your logic on preg_match('/^layout_builder\.overrides\.[a-z0-9_]+\.view$/', $url_object->getRouteName())

rajab natshah’s picture

rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajab natshah’s picture

Issue summary: View changes

✅ Release varbase-10.0.0

rajab natshah’s picture

Issue summary: View changes

--