From 577c522aeebd31434f1d99d74d7bd7f5cfe9cf03 Mon Sep 17 00:00:00 2001 From: boo-code Date: Sat, 27 Jun 2026 06:20:22 +0200 Subject: [PATCH] Skip meta pages whose route requires mandatory parameters in sitemap getMetaLink() calls Link::getPageLink() for every configurable meta page. When a meta page maps to a route that requires a mandatory parameter (e.g. a module search route needing an id), Dispatcher::createUrl() throws a PrestaShopException, which aborted the entire sitemap generation. Such routes cannot be represented in a sitemap without a specific value, so catch the exception and skip the page, letting generation continue. --- gsitemap.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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',