getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

array_key_exists exception on 1.7-rc10 with Gantry latest #74

Closed thekenshow closed 4 years ago

thekenshow commented 4 years ago

Installed Sitemap plugin, enabled, browsed to '/sitemap', got the array_key_exists(): The first argument should be either a string or an integer error on line 78 of sitemap.php:

$lang_available = (empty($page_languages) || array_key_exists($current_lang, $page_languages));
mahagr commented 4 years ago

FYI: Not related to Grav 1.7 but PHP 7.4.

thekenshow commented 4 years ago

This is happening on PHP 7.2.24.

mahagr commented 4 years ago

Thanks.

mahagr commented 4 years ago

It looks like $language->getLanguage() and $language->getDefault() can both return null.

CC @rhukster

mahagr commented 4 years ago

@thekenshow Workaround is to set (default) language in system.yaml.