Make "type" of error message configurable

Created on 29 July 2020, over 4 years ago
Updated 1 February 2025, 2 months ago

Problem/Motivation

In any configuration where this module sets an "error message" for the custom 404 page, the `drupal_set_message()` call hard codes the "type" of message as "error", which means it shows up styled by the theme layer as a BIG RED SCARY message, even though it's actually a friendly handling of "Oops, the page you're looking for was not here.

Steps to reproduce

Enable the module and configure it to show an error message.

Navigate to a non-existent page on your site, and see the message show up styled as an ERROR.

Proposed resolution

I'd like to add a configuration option to emit this message as one of the other statuses defined by the drupal_set_message() function (status or warning).

Remaining tasks

* create a config option for the admin to select what "type" of "error" message to show (status, warning, error)
* alter the drupal_set_message() call in search404.page.inc to use this config option

User interface changes

If we set the default selection for the new config option to 'error', then nothing changes from the current default behaviour, but the admin will have a new option on the config UI to select 'status' or 'warning' messages instead.

Release notes snippet

Added a configuration option to select the type of message emitted by the module when it handles a 404 page, so it can be rendered as a "status", "warning" or "error" message.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada spiderman Halifax, NS

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

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