backdrop-contrib / glightbox

Lightbox module for Backdrop CMS.
GNU General Public License v2.0
0 stars 3 forks source link

PHP notice: Trying to access array offset on value of type bool #5

Closed olafgrabienski closed 8 months ago

olafgrabienski commented 1 year ago

Thanks for this nice Lightbox module! When I visit a node with a gallery, I get this PHP notice:

Trying to access array offset on value of type bool in get_text_from_data() (line 117 of /my-path-to/modules/glightbox/glightbox.theme.inc).

This is the line in question: https://github.com/backdrop-contrib/glightbox/blob/1.x-1.x/glightbox.theme.inc#L117

The PHP version of the site is 7.4.33.

olafgrabienski commented 1 year ago

Just tested: I was able to reproduce the issue on a fresh Backdrop site created at backdropcms.org/demo. Steps:

korontari commented 1 year ago

@olafgrabienski , thank you for catching this! I will check and try to make a fix soon.

olafgrabienski commented 1 year ago

@korontari Friendly reminder. Did you have a chance to look into the issue?

korontari commented 1 year ago

@olafgrabienski , thank you for the reminder. I should be able to to fix that soon. My apologies, I was super busy recently.

olafgrabienski commented 1 year ago

Thanks @korontari, I understand. So no hurries (and no reason to apoligize).

olafgrabienski commented 9 months ago

Hi @korontari, recently I was working for a longer time on my Backdrop site where the Glightbox related PHP notices appear. I noticed really many of those notices in DBlog. I guess, to help code-wise is above my skills. Can I help in any other way to fix the issue?

korontari commented 9 months ago

@olafgrabienski , I am very sorry for the delay with fixing this bug! Could you please check the #6 PR and let me know if it works in your setup.

olafgrabienski commented 9 months ago

@korontari, there's no need for an apology, thank you very much for the fix! I've applied the changes in glightbox.module and glightbox.theme.inc from PR https://github.com/backdrop-contrib/glightbox/pull/6 to a dev version of the site in question, and the PHP notices are gone. So, works for me!

korontari commented 9 months ago

Thank you! I will roll out a new release soon.

If you have a bit of a spare time, may I ask you a favor and have a look at #2 and let me know if you understand that feature and if you have any ideas on making a clearer description of it?