Problem/Motivation

The error page takes its title and body from customerror.settings, but the render array from CustomErrorController::index() doesn't carry that config's cache tag. With Page Cache and Dynamic Page Cache on, saving a new title or body changes nothing on the site until caches are cleared. That goes for logged-out and logged-in visitors.

Steps to reproduce

  1. With Page Cache and Dynamic Page Cache on, set the 404 page to /customerror/404.
  2. Visit a missing page twice.
  3. Change the 404 title in the Custom error settings.
  4. Visit the missing page again. It still shows the old title.

Proposed resolution

Add the customerror.settings cache tags to the render array.

Tests:

  • A logged-out visitor sees the new title and body after they are saved (fails on HEAD).
  • A logged-in visitor sees the new title and body after they are saved (fails on HEAD).
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

loze created an issue. See original summary.

loze’s picture

Title: Error page cache is not cleared when the setting form is saved » Error page cache is not cleared when the settings form is saved
loze’s picture

Assigned: loze » Unassigned
Status: Active » Needs review