Missing image style for the Colorbox preview

Created on 21 May 2024, 26 days ago
Updated 10 June 2024, 6 days ago

Problem/Motivation

We have a view of the media field using the "Blazy Image" formatter. For the formatter settings, we selected Media switch - Image to Colorbox and set a specific Lightbox image style.

In most cases, it worked fine but during adding a URL for the image depending on the style of the Colorbox it just retrieves a URL to the image style but without checking if a file with this URL exists. We had an issue that the image was missing but the given URL and wasn't displayed in the Colorbox preview.

I suggest adding a validation to check if the file exists by the given URL if not then create it.
Not fully sure that this is a best way how to do it, maybe you will have better approach for that.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇦Ukraine _shY Lutsk

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

Comments & Activities

  • Issue created by @_shY
  • 🇺🇦Ukraine _shY Lutsk
  • Status changed to Needs review 26 days ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 26 days ago
    50 pass
  • 🇺🇦Ukraine _shY Lutsk
  • Status changed to Needs work 25 days ago
  • 🇮🇩Indonesia gausarts

    Thank you.

    It should be a bug if I could reproduce it. I'll see to it later. Or if anyone could confirm?

    I did notice an issue with image derivatives, IIRC in Views due to missing itok and double path styles, but thought it was already fixed some time ago, not sure about lightboxes.

    What is your blazy version?
    Still an issue with the latest?

    About the patch, please change condition from $style to use $styleable as done in the previous line so to exclude SVG.

  • Status changed to Fixed 20 days ago
  • 🇮🇩Indonesia gausarts

    Two posssibilities:

    • Outdated blazy version which may contain this issue as said previously. Please update.
    • Folder permissions. I deleted styles folder twice, and image derivatives are generated without issues, so no repro.

    About is_file, it is perfectly fine, however better and normally scoped: checking library files at install, can be disabled via UI like blur, dead zone of PHP like filter, or any permanently cached data etc., not on frequently used methods.

    Should be outdated, but fixed to avoid dups in the next two weeks.

    Feel free to re-open should you or anyone have persistent issues.

    Thank you.

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

Production build 0.69.0 2024