Call to undefined method Drupal\splidebox\Splidebox::verifySafely()

Created on 18 September 2023, 9 months ago
Updated 14 April 2024, 2 months ago

Problem/Motivation

Using Drupal 10.1.2 and Barrio theme. I formatted images field on a page to use Splide image and set Media switcher to Splidebox.

Trying to view the node results in the WSOD error,

Error: Call to undefined method Drupal\splidebox\Splidebox::verifySafely() in Drupal\splidebox\Splidebox->attachAlter() (line 43 of modules\contrib\splidebox\src\Splidebox.php).

Steps to reproduce

Configure the formatter and try saving/viewing a node of the type.

💬 Support request
Status

Fixed

Version

1.0

Component

Documentation

Created by

🇳🇬Nigeria chike Nigeria

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

Comments & Activities

  • Issue created by @chike
  • 🇮🇩Indonesia gausarts

    Thank you.

    May I know your versions for Blazy, Splide and Splidebox?
    Sounds like mismatched versions to me.

    The working should be their latest: Blazy:2.17, Splide:1.0.8 and Splidebox:1.0.2, and or their previous ones accordingly.
    They were intentionally released on the same date to avoid this type of issues.

  • 🇳🇬Nigeria chike Nigeria

    Thank you.

    I did install the latest version of Splide which installed Blazy dependency. Later I added Splidebox. I now looked at versions and see as Blazy 2.16.0, Splide 1.0.7, Splidebox 1.0.2.

    I updated to Blazy 2.16.0 and Splide 1.0.8 and now I get a new error,

    Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "blazy.svg".

  • Status changed to Fixed 9 months ago
  • 🇮🇩Indonesia gausarts

    They don't match expectation, and you got errors :)

    It must be:
    Blazy:2.17, Splide:1.0.8 and Splidebox:1.0.2

    Or:
    Blazy:2.16, Splide:1.0.7 and Splidebox:1.0.1

    See the release dates if unsure. Or just follow the above.

    That would fix this mismatched version issue.

    Feel free to re-open if still an issue.

    Thanks.

  • 🇳🇬Nigeria chike Nigeria

    Sorry I actually meant "I updated to Blazy 2.17.0 and Splide 1.0.8". Splidebox remained at 1.0.2.

  • 🇮🇩Indonesia gausarts

    If matching with such exact errors it is an obvious cache issue.

    Please check this out for detailed solutions:
    https://git.drupalcode.org/project/blazy/blob/8.x-2.x/docs/UPDATING.md

  • 🇳🇬Nigeria chike Nigeria

    Yes it needed a database update. I had cleared caches at every juncture but didn't think of updating the database.

    Now after updating the database the issue went away but the images are not loading in a lightbox.

  • 🇮🇩Indonesia gausarts

    Please press F12, find Console, and paste or screenshot JS errors, if any?

  • 🇳🇬Nigeria chike Nigeria

  • 🇮🇩Indonesia gausarts

    You may want to temporarily disable aggregation for better debug, and please re-screenshot it.

    What is your Splide library version?

    Currently only version 3 is supported. If using version 4, try downgrading it.
    See project home requirements, or docs.

  • 🇳🇬Nigeria chike Nigeria

    I disabled aggregation and got this log on the console,

    As for the library version I did check before downloading and reading on the project page,

    Splide library at minimum v3+ since 1.0.1:

    I took that to mean not less than v3+ so I took the latest version.

    Meanwhile after I downgraded to v3.6.12 the lightbox still didn't come up, and by the way the only problem is not the lightbox the carousel is also lost - one image stays on the page and the next image showing on the edge and no carousel and not navigation buttons showing. Once I turn off Splidebox the carousel comes back in shape. I tried now with Colorbox and everything works as expected.

    The error log with the v3 library is,

  • 🇮🇩Indonesia gausarts

    I could not reproduce it, yet. Your screenshots are helpful, thank you.

    We are almost on the same page.

    I noticed some errors somewhere, not sure related to this issue:
    https://git.drupalcode.org/project/blazy/-/commit/45ef0ff07778703cb30493...

    Mind testing the latest Blazy DEV for a moment to see if it is related to the OP?
    If you have a DEV environment, that would be safer.

    That is the only change of JS file I could remember since the latest releases.
    If the latest Blazy DEV didn't fix it, I would be informed to look into another spot in the least.

  • 🇳🇬Nigeria chike Nigeria

    Latest Blazy DEV didn't help. Behaviour stayed same and this error on the console,

    Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
    about:blank:1     Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
    drupal.js?v=10.1.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'bind')
        at R (apply.ts:27:15)
        at Sync (Sync.ts:151:12)
        at Splide.ts:124:25
        at forOwn.ts:20:30
        at Array.forEach (<anonymous>)
        at w (forOwn.ts:19:65)
        at n.mount (Splide.ts:123:13)
        at splide.load.min.js?v=10.1.2:1:921
        at init (splide.load.min.js?v=10.1.2:1:1172)
        at Array.forEach (<anonymous>)
    drupal.js?v=10.1.2:64 Uncaught TypeError: Cannot read properties of undefined (reading 'bind')
        at R (apply.ts:27:15)
        at Sync (Sync.ts:151:12)
        at Splide.ts:124:25
        at forOwn.ts:20:30
        at Array.forEach (<anonymous>)
        at w (forOwn.ts:19:65)
        at n.mount (Splide.ts:123:13)
        at splide.load.min.js?v=10.1.2:1:921
        at init (splide.load.min.js?v=10.1.2:1:1172)
        at Function.cn (dblazy.min.js?s1c5dd:1:2822)
    apply.ts:27 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bind')
        at R (apply.ts:27:15)
        at Sync (Sync.ts:151:12)
        at Splide.ts:124:25
        at forOwn.ts:20:30
        at Array.forEach (<anonymous>)
        at w (forOwn.ts:19:65)
        at n.mount (Splide.ts:123:13)
        at splide.load.min.js?v=10.1.2:1:921
        at Object.init (splide.load.min.js?v=10.1.2:1:1172)
        at Object.init (splidebox.load.min.js?s1c5dd:1:441)
    
  • Status changed to Postponed: needs info 9 months ago
  • 🇮🇩Indonesia gausarts

    > Latest Blazy DEV didn't help
    Got it. So I know where to look into. Unfortunately I couldn't reproduce it yet.

    Just one last check, please view the following in your browsers:

    The first two must say something clearly:
    Version : 3.6.12, not 4.x.x

    The first two depend on your composer or FTP, no problem.

    Once you verify they are accessible, no 404 nor 403, and have correct versions, it is most likely a bug I couldn't re-produce it, yet. Will see to it more.

    Thanks for persistent reports :)

  • 🇮🇩Indonesia gausarts

    Also kindly screenshot Splide or Blazy formatter/ Views style forms at your Manage display or Views UI where you got this problem, so I can match your situation for a repro.

    Thank you.

  • 🇳🇬Nigeria chike Nigeria

    http://MYSITE.COM/libraries/splidejs--splide/dist/js/splide.min.js
    http://MYSITE.COM/libraries/splide/dist/js/splide.min.js
    http://MYSITE.COM/modules/custom/splidebox/js/splidebox.min.js
    http://MYSITE.COM/modules/custom/blazy/js/dblazy.min.js

    I have these,

    screenshot Splide or Blazy formatter/ Views style forms at your Manage display or Views UI where you got this problem.

    I have this,

    your exported Splide optionset export: /admin/config/development/configuration/single/export

    I am using X Main optionset not yet duplicated for customization.

  • 🇮🇩Indonesia gausarts

    That is very helpful, thanks.

    Before I reproduce it, please update:

    • Leave Display style: EMPTY, or else fill out Grid Large accordingly. You are creating grid display but not filling in the Grid. For now, just empty Display style.
    • Aspect ratio: Fluid
    • Image style: Thumbnail, or anything small since you have Responsive image.

    Let me know if persists, so I can get back to test your config out myself.

  • 🇳🇬Nigeria chike Nigeria

    With this, the slide disappears on the page completely. If I remove image style (which I think I shouldn't set since I am using responsive image style), still it won't show, if I add a Display style back yet the slide won't show anymore but once I set switcher to colorbox it shows up again.

    The console,

  • 🇮🇩Indonesia gausarts

    Ok, weird.

    One last suspect.

    Keep your config like your last screenshot, but only change:
    Leave Responsive image EMPTY
    Fill in Image style with large images.

    I know that should not account under normal circumstances, but we are narrowing down suspects :)

    If persists, I will reproduce it this morning.

  • 🇳🇬Nigeria chike Nigeria

    Did that and still slide won't show up.

  • 🇮🇩Indonesia gausarts

    Got it.

    Assumed you are also using latest Blazy and Splidebox DEV releases, since that what I am currently having without issues.

    Will get back to you this morning.

    Thanks again.

  • 🇳🇬Nigeria chike Nigeria

    I was using latest DEV of Blazy but not Splidebox so now added latest DEV of Splidebox and same issue.

  • 🇮🇩Indonesia gausarts

    I just matched your two configs, and could not reproduce it yet, unfortunately.

    Please verify one last thing:
    What about Splide module? Should be the latest DEV, too. There was a JS fix for VIDEOs.
    Who knows related to yours?

    I'd love to finish this issue before tonight release. Hopefully we are on the same page now.
    Let me know?

  • 🇮🇩Indonesia gausarts

    I have just released new fixes:
    splidebox:1.0.3, splide:1.0.3, blazy:2.18

    Hopefully they reduced potential out of sync issues.

    If still an issue, I honestly have no other ideas what might cause this issue :)

    However the more info you provide the closer we are getting to solutions, normally.

    Do not hesitate to provide more reproducible steps, and screenshots.

    Let me know how it goes?
    Thank you.

  • 🇳🇬Nigeria chike Nigeria

    Thank you @gausarts, with the latest releases the issue has gone away. Splidebox is working now as expected.

    I noticed the lightbox is using the skyblue skin and thus the skyblue colors. Anyways I fixed my colors with CSS.

  • 🇺🇸United States mortona2k Seattle

    I got a WSOD with a similar error:

    TypeError: Drupal\splide\Entity\SplideBase::loadSafely(): Return value must be of type Drupal\splide\Entity\Splide, null returned in Drupal\splide\Entity\SplideBase::loadSafely() (line 128 of modules/contrib/splide/src/Entity/SplideBase.php).

    And more of the stacktrace:
    Drupal\splide\Entity\SplideBase::verifyOptionset(Array, 'default') (Line: 430)
    Drupal\splide\SplideManager->prepareSettings(Array, Array) (Line: 207)
    Drupal\splide\SplideManager->preRenderSplideWrapper(Array)

    In my case, I had deleted the default splide settings, but it looks like that is required.

  • 🇮🇩Indonesia gausarts

    > In my case, I had deleted the default splide settings, but it looks like that is required.
    You are correct.

    Default optionsets of any of my modules should not be modified, nor deleted as being warned about at their UI pages.

    However if you did, you can just as easily re-import or revert to defaults using config_update module.

    We'll figure out to handle such an edge case later :)

    Thanks for letting me know.

  • Status changed to Fixed 3 months ago
  • 🇮🇩Indonesia gausarts

    If still an issue, please update to Splidebox:2.x which works with Blazy:2.x and D8.8 since Splidebox:2.0.4.

    Closing this since 1.x is no longer supported.

    Thank you.

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

Production build 0.69.0 2024