Lightbox Not Working With v5 Update

Wappler Version : 5.1.1
Operating System : Windows
Server Model: NodeJS

Expected behavior

My images come from a URL like download/wa/790
Before this update, for lightbox, we used URL asdownload/wa/790?i=1.jpg to make this work.

Actual behavior

With the latest version 1.0.4 of this library, lightbox just returns the error “URL not supported”.
I have tried both download/wa/790?i=1.jpg & download/wa/790 as the HREF URL, but neither works.

The URL for image is a secure server connect route to keep the image name/naming-convention hidden, and access it via ID instead.
Is there a way to use such URLs in lightbox? I have reverted to previous version for now.

There was an update recently to fix issues where users used url like images.jpg?r=123124 where it adds a random number to prevent the file from being cached. The update now ignores the querystring and detects the type directly from the url without the querystring.

Do you have it on many places? You could change the route path to download/wa/:id/image.jpg so that it still works, you only need to update the lightbox url then.

More like many projects. :sweat_smile:
The route also has a optional param to return thumbnail - so its more like download/wa/:id/:thumb? at the moment.

If there is no other option or ideas, I will have to make the change - but will the route like download/wa/:id/:thumb?/image.jpg work?

Had finally updated my route as below:

/download/:id/1.jpg/:t?

For getting thumbnail images, src is set to eg: /download/33/1.jpg/1
And in href for lightbox, we use /download/33/1.jpg - which satisfies the lightbox URL change in v5, and also allows us to distinguish between thumbnail request and full-size image request.

Hi Patrick

I somehow missed this in a previous update. Does this mean the trick to stop image file caching no longer works? Have you now built it in so we don’t need that trick anymore?

Cheers, Jon.

The caching works all just fine, we are just ignoring the query string to when determinating the image type.

2 Likes

This has been improved in Wappler 5.3.2
The code has been updated to default to images when it can’t detect the type. You can also override the detection by selecting a content type in Lightbox UI. Currently image and video are supported types.

This topic was automatically closed after 3 days. New replies are no longer allowed.