backdrop-contrib / icon_browser

An interface to browse the fonts that are available on a Backdrop site.
GNU General Public License v2.0
1 stars 3 forks source link

Warnings when click on icon #12

Closed yorkshire-pudding closed 3 weeks ago

yorkshire-pudding commented 3 weeks ago

Installed using the prerelease branch

Load page. Click on icon

Warning: Undefined global variable $theme_key in _icon_from_theme() (line 137 of /app/docroot/core/includes/icon.inc). Warning: Undefined array key "" in _icon_from_theme() (line 158 of /app/docroot/core/includes/icon.inc).

indigoxela commented 3 weeks ago

Same here. :wink:

laryn commented 3 weeks ago

Thanks @yorkshire-pudding and @indigoxela -- I found the same. I opened it as a core issue but will leave this one open as well until we figure out for sure if it's something I did wrong in this module or if it's actually a core issue:

laryn commented 3 weeks ago

@yorkshire-pudding or @indigoxela -- if either of you have your icon browser test site open yet, does the linked PR solve it for you? I guess that 'path' may not be needed?

indigoxela commented 3 weeks ago

I belief, it's core.

If I set backdrop_theme_initialize(); inside function _icon_from_theme() everything works. Not matter, where I try backdrop_theme_initialize in your module - the problem persists.

The error reminded me, that the theme information is usually available for themes, but not for modules.

indigoxela commented 3 weeks ago

@laryn yes, the patch (one liner) fixes it. :+1:

yorkshire-pudding commented 3 weeks ago

Was getting a cup of tea, but can also confirm this fixes it. Thanks @laryn

laryn commented 3 weeks ago

🍵 I've also renamed the branch, FYI. Not sure why I started that way, to be honest.