- Issue created by @janpongos
- Status changed to Needs review
5 months ago 11:41am 20 June 2024 - 🇭🇺Hungary nagy.balint
I had the same issue.
Thanks for the patch, it works for me to remove the error.
Found a massive log of this every time cron is attempting to run and this persistently logging due to failed cron.
TypeError: _xmlsitemap_element_add_alternate_lang(): Argument #3 ($language) must be of type Drupal\Core\Language\LanguageInterface, null given, called in /myapplication/web/modules/contrib/xmlsitemap/xmlsitemap.module on line 1874 in _xmlsitemap_element_add_alternate_lang() (line 1893 of /myapplication/web/modules/contrib/xmlsitemap/xmlsitemap.module)
I have checked default language is set to "en". I have also checked in the database xmlsitemap table, no data their that has null value for "language" either. Any idea?
Drupal 9.4.8
Xmlsitemap 1.4
Enable drupal cron
Temporary solution: added a check if "xmlsitemap_language_load($language_link['language'])" has a value.
Needs review
1.4
xmlsitemap.module
I had the same issue.
Thanks for the patch, it works for me to remove the error.