backdrop-contrib / metatag

Add structured metadata, aka "meta tags", for various pages on your site.
GNU General Public License v2.0
3 stars 15 forks source link

Undefined index: in theme_get_setting() #16

Closed ghost closed 5 years ago

ghost commented 6 years ago

When the metatag_favicons module is enabled, this error message is shown on most forms:

Notice: Undefined index: in theme_get_setting() (line 1463 of /[SNIP]/core/includes/theme.inc).

It's to do with this code from metatag_favicons.module:

function metatag_favicons_get_theme_favicon() {
  $favicon_url = '';

  // Is the favicon enabled?
  if (theme_get_setting('toggle_favicon')) {
    $favicon_url = theme_get_setting('favicon');
  }

  return $favicon_url;
}

Maybe theme_get_setting('toggle_favicon') needs to be changed to something like config_get('system.core', 'site_favicon_theme')...?

jenlampton commented 5 years ago

Hm, The line it doesn't like is 1463, or $theme_info = $themes[$theme];. Is this a problem in every other instance of theme_get_setting()? I'll check core...

jenlampton commented 5 years ago

Ah I see. Sometimes the theme returned is an empty string in line 1450, we just need to check for that. See https://github.com/backdrop/backdrop-issues/issues/3981