gallery-block-lightbox icon indicating copy to clipboard operation
gallery-block-lightbox copied to clipboard

Incompatibility with Image Source Control Plugin

Open SchneiderSam opened this issue 1 year ago • 13 comments

Description There is an incompatibility between the gallery-block-lightbox plugin and the Image Source Control plugin by Thomas Maier (https://wordpress.org/plugins/image-source-control-isc/).

Specifically, the lightbox functionality fails when dealing with links within elements that have the class "isc-source-text".

Steps to Reproduce

  • Install and activate the gallery-block-lightbox plugin.
  • Install and activate the Image Source Control plugin by Thomas Maier. https://wordpress.org/plugins/image-source-control-isc/
  • Add an image with a source link that uses the "isc-source-text" class.

Expected Behavior The lightbox should function correctly and links within elements with the class "isc-source-text" should navigate to the external website.

Actual Behavior The lightbox does not function correctly with links within elements with the class "isc-source-text". When I click on the link, the lightbox opens, but not the link. Although the link is displayed correctly at the bottom left. If I deactivate the lightbox, the link works correctly again.

Suggested Solution Please modify the gallery-block-lightbox plugin to ignore links within elements that have the class "isc-source-text". This should resolve the conflict and allow both plugins to work together seamlessly.

SchneiderSam avatar Aug 08 '24 07:08 SchneiderSam

FYI, I am the developer of Image Source Control and had a look at this before. It seems that the click event is used to trigger the lightbox, hence my suggestion to exclude links in the isc-source-text class from it. Let me know if you have any questions.

webzunft avatar Aug 08 '24 07:08 webzunft

Hi @SchneiderSam @webzunft,

I tried to reproduce the issue but it works fine for me:

qie7aTfO wcHdjvDJ

But I don't see any links with the isc-source-text in the source code.

goaround avatar Aug 08 '24 08:08 goaround

@goaround thanks for the response. I think you have to aactivate the overlay: image

Not sure if you need the PRO Version @webzunft ?! :-)

SchneiderSam avatar Aug 08 '24 08:08 SchneiderSam

I can't choose "Zeige das Overlay innerhalb von HTML-Tags mit Inline Style" with the free version.

Can you please send me a link to your website where I can see the issue?

goaround avatar Aug 08 '24 08:08 goaround

https://baubeaver.de/fachwerkhaus/

For example: image

"Franzfoto..." is the Brokenlink. The next Link works fine image

SchneiderSam avatar Aug 08 '24 08:08 SchneiderSam

I think I have the same problem when I haven't activated the function "Zeige das Overlay innerhalb von HTML-Tags mit Inline Style". Interestingly, the link to the license key works, but not directly to the image. So left doesn't work, right does.

SchneiderSam avatar Aug 08 '24 08:08 SchneiderSam

As far as I can see, the images are embedded directly in the content. No Pro features needed. Though it seems that one needs to enable licenses and add a linked license to the image.

webzunft avatar Aug 08 '24 08:08 webzunft

Ok, I found the issue. Baguettbox.js tries to create a Lightbox for every link which contains an image (jpg, png... at the end of the href attribute) inside .wp-block-image Unfortunately the Wikipedia-Link here https://commons.wikimedia.org/wiki/File:Winterstettenstadt_-_Fachwerkhaus_im_Blumenschmuck.jpg ends with .jpg but it's not an image.

Unfortunately, I can't exclude the class .isc-source-text because its already inside .wp-block-image

My suggestion would be to add a # at the end of the link e.g. https://commons.wikimedia.org/wiki/File:Winterstettenstadt_-_Fachwerkhaus_im_Blumenschmuck.jpg# and it works fine because it's not recognized as an image anymore.

goaround avatar Aug 08 '24 08:08 goaround

Otherwise @webzunft has to add a class to the a-tag directly, and then I can exclude the lightbox for this link, but the class has to be on the a-tag.

goaround avatar Aug 08 '24 08:08 goaround

Thanks @goaround . Since I have full control over the a tag, I can add a class to them. Any preferred choice?

webzunft avatar Aug 08 '24 09:08 webzunft

isc-source-link?

goaround avatar Aug 08 '24 09:08 goaround

Since this is only for compatibility between our plugins, I wouldn’t want to add markup that 99% of users wouldn’t need. How about a class I only add if your plugin is also enabled with your name in it?

webzunft avatar Aug 08 '24 09:08 webzunft

Then use no-lightbox

goaround avatar Aug 08 '24 09:08 goaround

@goaround would you be able to reach out to me via https://imagesourcecontrol.de/support/ so I can share a test site with you we can use to test the solution?

webzunft avatar Aug 17 '24 13:08 webzunft

@goaround Are there already plans for when this will be implemented? :-)

SchneiderSam avatar Aug 20 '24 08:08 SchneiderSam

Hi @SchneiderSam @webzunft,

Already done two weeks ago: https://github.com/goaround/gallery-block-lightbox/releases/tag/1.14

If it does not work as expected, please provide a link where I can check the issue.

goaround avatar Aug 20 '24 08:08 goaround

@goaround thanks so much. And also thanks for implementing GenerateBlocks. 🥳

SchneiderSam avatar Aug 20 '24 08:08 SchneiderSam

Thanks @goaround , I applied the class to our image source links and saw that it works. It will go out with the next update of the main plugin.

webzunft avatar Aug 20 '24 15:08 webzunft