diff --git a/gsitemap.php b/gsitemap.php index adb4ae0..8a41e4c 100755 --- a/gsitemap.php +++ b/gsitemap.php @@ -481,7 +481,15 @@ protected function getMetaLink(&$link_sitemap, $lang, &$index, &$i, $id_meta = 0 $url = ''; if (!in_array($meta['id_meta'], explode(',', Configuration::get('GSITEMAP_DISABLE_LINKS')))) { - $url = $link->getPageLink($meta['page'], null, $lang['id_lang']); + try { + $url = $link->getPageLink($meta['page'], null, $lang['id_lang']); + } catch (PrestaShopException $e) { + // Some meta pages map to routes that require mandatory parameters + // (e.g. a module search route needing an id). Such routes cannot be + // represented in a sitemap without a specific value, so we skip them + // instead of aborting the whole sitemap generation. + continue; + } if (!$this->addLinkToSitemap($link_sitemap, [ 'type' => 'meta',