Empty "page" argument leads to php error

Created on 2 February 2023, almost 2 years ago
Updated 19 July 2024, 6 months ago

Problem/Motivation

This is an edge case, but I was just alerted to this issue via our error monitoring.

TypeError: Drupal\simple_sitemap\Manager\Generator::getContent(): Argument #1 ($delta) must be of type ?int, string given, called in /app/web/modules/contrib/simple_sitemap/src/Controller/SimpleSitemapController.php on line 61 in Drupal\simple_sitemap\Manager\Generator->getContent() (line 139 of /app/web/modules/contrib/simple_sitemap/src/Manager/Generator.php) #0 /app/web/modules/contrib/simple_sitemap/src/Controller/SimpleSitemapController.php(61): Drupal\simple_sitemap\Manager\Generator->getContent('')
#1 [internal function]: Drupal\simple_sitemap\Controller\SimpleSitemapController->getSitemap(Object(Symfony\Component\HttpFoundation\Request), 'default')

Steps to reproduce

Visit /sitemap.xml?page=

Proposed resolution

Load page 0 instead of throwing an error. Make 0 the default argument value.

Remaining tasks

Set a default value for the page parameter.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024