Skip to content

Setting a default 404 page fails if there are many templates #4762

Description

@nep

Description of the problem
On the Template settings screen, you can set a default 404 page template.

The initial list of templates is limited in number for performance reasons. But you can search all the templates to find the one you want to use.

However, if you try to choose a template that was NOT in the initial list, you are given a validation error and you cannot save your choice.

Therefore you can only currently set the 4040 template to something in the initial list of values, which is limiting.

There is a workaround: set it in config.php. But this is not a good longterm solution.
$config['site_404'] = 'search/404-page';

You can also change the name of the template to something alphabetically prioritized. Again, not a good longterm solution.

How To Reproduce
Steps to reproduce the behavior:

  1. Start with a site that has many templates.
  2. Go to the Template Settings screen.
  3. Use the search box on the 404 setting to choose a template that is NOT in the initial list
  4. When you select that template, you get the error message: "The option you selected is not valid." and you cannot save the settings
  5. See screenshot below.

Error Messages


The option you selected is not valid.

Screenshots / Videos / Template Code
Image

Environment Details:

  • Version: 7.5.8
  • PHP Version
  • MySQL Version
  • OS:
  • Web Server:

Possible Solution
The validation options appear to be set at load time. They should refresh when the search returns values.

Additional context
I would be curious if to see if this bug happens on any other places in the UI where an initial validation list of values is loaded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: AcceptedBug has been confirmed, is reproducible, and ready to work on.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions