Skip to content

Commit

Permalink
Redirect on missing page
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Apr 5, 2024
1 parent 74d65cc commit c4f7924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% extends 'blitz/_utilities/diagnostics/layouts/page' %}

{% set page = craft.blitz.diagnostics.getPage() %}
{% if page is null %}
{% redirect 'blitz/diagnostics/pages' with error 'The page no longer exists or may have been refreshed.' %}
{% endif %}
{% set element = craft.blitz.diagnostics.getElementOfType(page.id) %}
{% set title = 'Tracked ' ~ element.displayName ~ ' Queries' %}
{% set crumbs = [
Expand Down
3 changes: 3 additions & 0 deletions src/templates/_utilities/diagnostics/pages/element-type.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% extends 'blitz/_utilities/diagnostics/layouts/page' %}

{% set page = craft.blitz.diagnostics.getPage() %}
{% if page is null %}
{% redirect 'blitz/diagnostics/pages' with error 'The page no longer exists or may have been refreshed.' %}
{% endif %}
{% set element = craft.blitz.diagnostics.getElementOfType(page.id) %}
{% set title = 'Tracked ' ~ element.pluralDisplayName %}
{% set crumbs = [
Expand Down

0 comments on commit c4f7924

Please sign in to comment.