- Issue created by @jorielsaikali
- 🇺🇦Ukraine Goodmood
I confirm, that this is the issue. Have the same problem after upgrade to 10.1 (from 9)
- 🇧🇴Bolivia alvarito75 Cochabamba
I created a patch to remove an edge case since this only happens with a block with multiple autocomplete field
- 🇧🇴Bolivia alvarito75 Cochabamba
There is a new patch created based on the current branch of Gin Layout Builder 1.0.0-rc4
- Assigned to Grimreaper
- Status changed to Needs work
over 1 year ago 3:04pm 21 August 2023 - 🇫🇷France Grimreaper France 🇫🇷
Hi,
I think hook_css_alter and aggregating all Gin LB CSS into one file has reached its limit because then it is not possible to declare proper library dependency to control the CSS load ordering.
Maybe a big refactoring of the CSS of the module is needed...
Adding related issues because the solution may be common.
- Issue was unassigned.
- 🇧🇴Bolivia alvarito75 Cochabamba
I'm still having these issues.
What I did recently:
- Gin theme updated from to RC4 -> RC5
- Gin 8.x-3.0-rc5
- Still Drupal 10.1.2
These tests I did might help understand the issue in more use cases, please see attached images:
- Adding a block
- Working with sortable content
- I added a pair of images when the CSS/JS Aggregation is turned off
- I added a pair of images when the CSS/JS Aggregation is turned on
- The images are about adding blocks and editing content with sortable capabilities
Some things I tried:
- I created new custom libraries and copied the Gin LB libraries into my custom module and I turned on the CSS/JS Aggregation to see if the issue was still there and I got the same problem
- I debugged the CSS and JS in Firefox but it seems CSS/JS from Gin LB is not being aggregated
- Also I noticed that for the Gin LB CSS, the variables are not working properly in Chrome but they work well in Firefox
I hope this info is useful while I'll be
Btw I just saw another release for Gin, I'll test it and let you know
- 🇨🇭Switzerland phma Basel, CH
I was trying to get gin_lb to work on our site. But going to 10.1 and enabling aggregation caused the core CSS to reapply which resulted in a rather messy output.
I did some debugging and hook_css_alter does still run. But it seems like aggregation relies on the libraries more than the individual files. As a workaround, I managed to disable the libraries using
libraries-override
. Just paste the code below into your theme's info file. Refactoring is probably a good idea. Unfortuantly, those libraries overrides only work for themes. But maybe we can usehook_libraries_info_alter
instead?libraries-override: layout_builder/drupal.layout_builder: css: theme: css/layout-builder.css: false core/drupal.dialog.off_canvas: css: base: misc/dialog/off-canvas/css/reset.css: false misc/dialog/off-canvas/css/base.css: false misc/dialog/off-canvas/css/utility.css: false component: misc/dialog/off-canvas/css/button.css: false misc/dialog/off-canvas/css/drupal.css: false misc/dialog/off-canvas/css/form.css: false misc/dialog/off-canvas/css/table.css: false misc/dialog/off-canvas/css/details.css: false misc/dialog/off-canvas/css/messages.css: false misc/dialog/off-canvas/css/tabledrag.css: false misc/dialog/off-canvas/css/throbber.css: false misc/dialog/off-canvas/css/dropbutton.css: false misc/dialog/off-canvas/css/titlebar.css: false misc/dialog/off-canvas/css/wrapper.css: false core/drupal.autocomplete: css: theme: assets/vendor/jquery.ui/themes/base/theme.css: false core/drupal.dialog: css: component: assets/vendor/jquery.ui/themes/base/dialog.css: false system/base: css: component: css/components/tabledrag.module.css: false
- 🇬🇧United Kingdom catch
The problem is the call to gin_lb_is_layout_builder_route(). Needs to check for the presence of a layout builder library or similar instead.
- 🇨🇭Switzerland phma Basel, CH
Thanks @catch. I can confirm that this approach works. I didn't realise the hook is being executed again during aggregation.
See patch attached for a quick fix. Probably needs more thought on what we check and some cleanup.
- 🇮🇳India shubham_jain
hi everyone, I need to solve this error I need to add code in comment#10 that in my theme and apply the patch in the module file.
Is that right. Correct me if I am wrong.
- 🇨🇭Switzerland phma Basel, CH
hi @shubham_jain. I've not done exessive testing on it yet, but you can use either method. Both should produce the same effect, but may have different side effects depending on your installation.
- Status changed to Needs review
about 1 year ago 8:28am 5 September 2023 - 🇧🇴Bolivia alvarito75 Cochabamba
Thanks, @phma for the patch
After my test, I can verify it is working for most cases but still have edge cases, below are the versions of the project I'm working on:
Drupal Setup
- Gin theme 8.x-3.0-rc5
- Gin Layout Builder 1.0.0-rc4
- Drupal 10.1.2
The edge case is for an autocomplete field, please see the attached image.
I'll continue testing
- Assigned to Grimreaper
- Status changed to RTBC
about 1 year ago 3:30pm 11 September 2023 - 🇫🇷France Grimreaper France 🇫🇷
I have tested with the latest dev version of gin_lb on Drupal 10.1.3.
And on a Drupal 9.5.10.
It fixes the problem!
Thanks a lot for the patch! I will merge it.
- @grimreaper opened merge request.
-
Grimreaper →
committed f9208721 on 1.0.x authored by
phma →
Issue #3377132 by alvarito75, Grimreaper, phma, catch, jorielsaikali:...
-
Grimreaper →
committed f9208721 on 1.0.x authored by
phma →
- Issue was unassigned.
- Status changed to Fixed
about 1 year ago 3:34pm 11 September 2023 - 🇨🇦Canada vincent signoret
Like mentioned in #16 I also have an with the autocomplete element. I'm not sure if it's related to this problem.
- 🇺🇸United States rpearl
Also finding issues when trying to use the Field Group module along with this. You can't group items in an accordion or tabs, they just won't work. Probably should be another ticket, but because of things like this, the resolution/patch for this current issue may need to be thought about.
Automatically closed - issue fixed for 2 weeks with no activity.