Overview

\Drupal\experience_builder\Hook\ComponentSourceHooks::pageAttachments() is too eager: it blindly does

$page['#attached']['library'][] = AssetLibrary::load(AssetLibrary::GLOBAL_ID)->getAssetLibrary($is_preview);

Proposed resolution

Load it only when the negotiated/active theme is the currently configured default theme.

User interface changes

None — other than global CSS no longer loading when it shouldn't.

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

wim leers created an issue. See original summary.

wim leers credited mglaman.

wim leers’s picture

Reported by @mglaman in chat.

wim leers’s picture

Assigned: Unassigned » mglaman
Status: Active » Needs review
wim leers’s picture

Issue tags: +backport

This can break the admin theme! 😅🙈

wim leers’s picture

Assigned: mglaman » Unassigned
Status: Needs review » Needs work

I bet this fails because

    // Case 3: Route with _xb_use_template_draft should use regular asset
    // library if there is no auto-saved version.
    $assert_library_global_library('/xb/api/v0/layout/xb_page/' . $page->id(), TRUE);

does not negotiate the default theme.

penyaskito made their first commit to this issue’s fork.

penyaskito’s picture

Assigned: Unassigned » wim leers
Status: Needs work » Needs review

Simpler than that:

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community

Whoops — pretty evident now that I just threw up an MR without actually testing it! 😇

#9: RE: subdir — how come this worked fine until now?! 😳

penyaskito’s picture

#10 I haven't seen them fail nor tested it, but I was pretty sure this could be a problem?

wim leers’s picture

Assigned: Unassigned » wim leers
wim leers’s picture

Assigned: wim leers » Unassigned

Reverting those test changes passed just fine after locally I was convinced they were not needed — yay, zero concerns left! 🥳

  • wim leers committed e71d8b45 on 1.x
    Issue #3537666 by wim leers, penyaskito, mglaman: The `global` `...
wim leers’s picture

Assigned: Unassigned » balintbrews
Status: Reviewed & tested by the community » Patch (to be ported)

balintbrews’s picture

Assigned: balintbrews » Unassigned
Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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