Simple Sitemap should typehint modulehandler interface rather than a specific implementation

Created on 15 February 2022, almost 3 years ago
Updated 19 July 2024, 5 months ago

This issue is for version 3 of the project, which I understand is still receiving bug fixes. V4 already had this issue corrected via a bulk coding standards improvement in 📌 Coding standards Fixed .

Problem/Motivation

\Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapGeneratorBase and \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\ArbitraryUrlGenerator classes currently typehint the default ModuleHandler class instead of the interface. This prevents custom overrides of ModuleHandler, for example by https://drupal.org/project/hux

Steps to reproduce

Install Hux and Simple Sitemap.
Navigate to a page which triggers either class to be instantiated.
Result: Uncaught WSOD/Exception.

Proposed resolution

Typehint the property with interface.

Remaining tasks

Review and commit.

User interface changes

Nil.

API changes

Nil.

Data model changes

Nil.

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇦🇺Australia dpi Perth, Australia

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