QuizAccessDeniedSubscriber breaks system.site settings for 404 repsonses

Created on 9 January 2025, 2 months ago

Problem/Motivation

Installing this module breaks core functionality. The system.site settings that serve custom pages for 404 responses are superseded by the priority level set in the Quiz module's `QuizAccessDeniedSubscriber` class. This means that a site that is normally supposed to serve a custom 404 page will instead serve a text string `The requested page could not be found. `

Normally, when system.site['page']['404'] is set, 404 responses will trigger CustomPageExceptionHtmlSubscriber::on404() which is tied to the EventSubscriber system. When the quiz module is installed, 404 responses trigger Http4xxController::on404(), which is the default controller. This points to the fact that the QuizAccessDeniedSubscriber class sets a higher priority for the EventSubscriber than CustomPageExceptionHtmlSubscriber.

Steps to reproduce

Before installing the quiz module, create a node for a custom 404 page. Then at admin/config/system/site-information, set the custom 404 page to the previously created node. Then visit a malformed URL. The custom 404 page should render.

Install the quiz module. Then visit a malformed URL. The page will render the Http4xxController::on404() message "The requested page could not be found. "

Proposed resolution

Find a different way of handling 403 requests for quiz nodes that does not interfere with core functionality. Either by setting a check for node types, or extending a different class.

🐛 Bug report
Status

Active

Version

7.0

Component

Code - Quiz core

Created by

🇺🇸United States mgaskey

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