Skip to content

[BUG] Dispatcher::createUrl() miss required parameter "id_search" for route "module-pm_advancedsearch-searchresults" #193

Description

@Daaaaad

Prerequisites

Describe the bug and add attachments

When generating the sitemap, gsitemap throws a PrestaShopException when encountering module routes that require mandatory parameters.

Expected behavior

The sitemap should be generated successfully, ignoring routes that require mandatory parameters (as they cannot be included in a sitemap without specific values).

Actual behavior:

A PrestaShopException is thrown:
Dispatcher::createUrl() miss required parameter "id_search" for route "module-pm_advancedsearch-searchresults"at line 998 in file classes/Dispatcher.php

Error stack trace:

DispatcherCore->createUrl - [line 1161 - classes/Link.php]LinkCore->getPageLink - [line 403 - modules/gsitemap/gsitemap.php]Gsitemap->getMetaLink - [line 755 - modules/gsitemap/gsitemap.php]Gsitemap->createSitemap - [line 208 - modules/gsitemap/gsitemap.php]

Steps to reproduce

  1. Install a module that defines routes with required parameters (e.g., pm_advancedsearch with route module-pm_advancedsearch-searchresults requiring id_search)
  2. Go to gsitemap configuration
  3. Uncheck some meta pages to include them in the sitemap
  4. Click "Generate sitemap"

PrestaShop version(s) where the bug happened

5.0.0

PHP version(s) where the bug happened

8.2.1

Your company or customer's name goes here (if applicable).

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions