- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
I'm not totally sure if this is a bug in blazy.once or in slick. We've seen this on D11 projects, I'll try to find out, if same happens in D10.
- 🇩🇪Germany Anybody Porta Westfalica
Okay, rewriting the
attach()
toonce()
works flawlessly:attach: function (context) { // _d.once(doSlick, _id, _element, context); once(_id, _element, context).forEach((mySlider) => { doSlick(mySlider); }); },
So I guess this is really a blazy.once(.min).js bug?
- Merge request !15Draft: Issue #3538028 by anybody: Slick does not initialize for admin (and possibly other cases with multiple attach/AJAX calls) → (Open) created by Anybody
- 🇮🇩Indonesia gausarts
Thank you.
> Slick sliders are not initialized for admin users
Is it only bad at admin pages, or any pages for admin?We need more info to narrow down triggering contexts:
- What Drupal version? Fine at D10?
- Slick version according to the supported one? See project home for sure, also apply D11 fixes if D11.
- Is it fine without BigPipe?
The only reason Blazy extended core once was to deal with known BigPipe glitches given various contexts: AJAX in infinite pagers vs regular AJAX, multiple calls/renders of BigPipe causing particular initializes (library/script loaders) messed up, multiple Slick sliders in infinite pagers, etc.
So the fix should go to Blazy, if later proven BigPipe, or in this module if anything else like D11 compat, etc.
- 🇩🇪Germany Anybody Porta Westfalica
Hi @gausarts thanks for your quick reply!
I'l try debugging this deeper and will also try to reproduce this in vanilla Drupal using the admin menu modules, so hopefully you can also easily reproduce this. Very busy days, hopefully this week!
- 🇮🇩Indonesia gausarts
Take your time :)
On second thought, enabling Use AJAX option at Views UI RHS, should fix it.
It is less expensive and problematic than any proposed solutions above. More efficient than loading AJAX scripts for all Views blocks.
UI fixes are equally valid as codes.
Pretty much similar to the linked issue, only less clear :)
Feel free to re-open if persists, though. Be sure to reply to my previous questions properly for better scopes.
- 🇩🇪Germany Anybody Porta Westfalica
@gausarts thanks! Enabling "use ajax" is also a nice workaround option, but I think it's just too dangerous. Slick views don't need AJAX logically, right and this happens with any slick view if admin_toolbar is used.
So any site maintainer changing the views setting would break it... From my perspective it needs to be fixed in code...
- 🇮🇩Indonesia gausarts
Actually I couldn't reproduce your issue with D11 and BigPipe.
But I understand the underlying problem as previously mentioned.
I added a new commit to avoid enabling Views AJAX without unneeded AJAX inclusion or risking a regression by modifying the existing scripts:
https://git.drupalcode.org/project/blazy/-/commit/62ec0b769337ef6aeefe78...If you could test out the latest Blazy DEV and confirm OK, we'd probably have a new release soon.
Thank you.