Simple XML Sitemap generation - unknown langcode

Created on 2 November 2021, about 3 years ago
Updated 29 November 2023, 12 months ago

Problem/Motivation

Error thrown during Simple XML Sitemap generation (initiated by cron or manually).
Notice: Undefined index: langcode in disable_language_simple_sitemap_links_alter() (line 142 of /app/web/modules/contrib/disable_language/disable_language.module) @backtrace_string.

--> "loc"-links not having a "langcode" property in the link array.

// Remove 'loc' URL if it points to a disabled language.
if (in_array($link['langcode'], $disabledLanguagesLangCodes)) {
  unset($links[$key]);
}

Proposed resolution

Check if $link['langcode'] exists.

// Remove 'loc' URL if it points to a disabled language.
if (isset($link['langcode']) && in_array($link['langcode'], $disabledLanguagesLangCodes)) {
  unset($links[$key]);
}
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium jover Leuven πŸ‡§πŸ‡ͺ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024