CSS, JS not loaded on module install in Drupal 10.4.0-dev

Created on 9 May 2024, 8 months ago

Problem/Motivation

When this module is first installed on Drupal 10.4.0-dev, the markup correctly uses the markup from the twig templates, but the CSS and JS are not loaded until the cache is cleared, causing the buttons to look broken and not behave as expected.

Steps to reproduce

On a fresh install of Drupal 10.4.0-dev, install this module and then go to the form to add a basic page.

Proposed resolution

Add a hook_install implementation to clear the necessary caches.

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada mandclu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mandclu
  • Merge request !63Add hook_install β†’ (Merged) created by mandclu
  • Status changed to Needs review 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    For me, this small fix is not enough. I have an additional change I'd love to see in this fix. @mandclu may I extend your MR with it?

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    I got sign-off on this change in slack (#preview channel if you want to jump in.)

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul
  • Status changed to Fixed 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul
  • Status changed to Needs work 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Re-opening.

    When enabled as part of an initial install this is fine (which unblocks this for the Starshot prototype) but I'm still seeing the original issue when later installing this in the UI or via drush. Probably not as high a priority, but still an odd install thing that we should probably get to the bottom of.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    Original issue meaning the large buttons?

  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    > Original issue meaning the large buttons?

    Yup the large buttons which is a symptom of the assets for our single file components not loading.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    In rethinking this issue. I think we're due to a refactoring of the component css. I don't think we actually need to make the svgs a variable that the component can vary.

    If these buttons were reused in some key way maybe, but right now they only have a single purpose. So it makes sense to only vary the bits that make sense.

    As a bonus, by providing the svg definition via a full SVG tag, we can vary the fill / background color via css. That's not something we can do with a background-image url.

  • Merge request !75Improve handling of SVG icons β†’ (Open) created by cosmicdreams
  • Status changed to Closed: outdated 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    We've already applied this fix.

Production build 0.71.5 2024