Skip to content

Commit

Permalink
Ensure displayName() method is called
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Oct 22, 2024
1 parent a7b7e6c commit caf1bab
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Fixed

- Fixed a bug on the Tracked Element Queries page in the Blitz Diagnostics utility ([#716](https://github.com/putyourlightson/craft-blitz/issues/716)).
- Fixed a bug in the Blitz Diagnostics utility that could throw an error if a custom field existed with the handle `displayName` ([#723](https://github.com/putyourlightson/craft-blitz/issues/723)).
- Fixed a bug in the Blitz Diagnostics utility when using a Postgres database ([#724](https://github.com/putyourlightson/craft-blitz/issues/724)).

## 5.9.0 - 2024-10-04
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% extends 'blitz/_utilities/diagnostics/layouts/element-queries' %}

{% set element = craft.blitz.diagnostics.getElementOfType() %}
{% set title = 'Tracked ' ~ element.displayName ~ ' Queries' %}
{% set title = 'Tracked ' ~ element.displayName() ~ ' Queries' %}

{% block content %}
{{ sprig('blitz/_utilities/diagnostics/_components/elementQueries', {
siteId: siteId,
elementType: className(element),
displayName: element.displayName,
pluralDisplayName: element.displayName ~ ' Queries',
displayName: element.displayName(),
pluralDisplayName: element.displayName() ~ ' Queries',
}) }}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<a href="{{ url('blitz/diagnostics/element-queries/element-query-type', {
elementType: elementQueryType.type
}) }}">
{{ create(elementQueryType.type).displayName }} Queries
{{ create(elementQueryType.type).displayName() }} Queries
</a>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% set codeTitle = true %}
{% set crumbs = [
{
label: 'Tracked ' ~ element.displayName ~ ' Queries',
label: 'Tracked ' ~ element.displayName() ~ ' Queries',
url: cpUrl('blitz/diagnostics/element-queries/element-query-type', { 'elementType': className(element) }),
},
] %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% redirect 'blitz/diagnostics/includes' with error 'The include no longer exists or may have been refreshed.' %}
{% endif %}
{% set element = craft.blitz.diagnostics.getElementOfType(include.id) %}
{% set title = 'Tracked ' ~ element.displayName ~ ' Queries' %}
{% set title = 'Tracked ' ~ element.displayName() ~ ' Queries' %}
{% set crumbs = [
{
label: include.index,
Expand All @@ -19,6 +19,6 @@
cacheId: include.id,
elementType: className(element),
displayName: element.displayName,
pluralDisplayName: element.displayName ~ ' Queries',
pluralDisplayName: element.displayName() ~ ' Queries',
}) }}
{% endblock %}
2 changes: 1 addition & 1 deletion src/templates/_utilities/diagnostics/includes/include.twig
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
includeId: include.id,
elementType: elementQueryType.type
}) }}">
{{ create(elementQueryType.type).displayName }} Queries
{{ create(elementQueryType.type).displayName() }} Queries
</a>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% 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 title = 'Tracked ' ~ element.displayName() ~ ' Queries' %}
{% set crumbs = [
{
html: tag('a', {
Expand All @@ -22,6 +22,6 @@
cacheId: page.id,
elementType: className(element),
displayName: element.displayName,
pluralDisplayName: element.displayName ~ ' Queries',
pluralDisplayName: element.displayName() ~ ' Queries',
}) }}
{% endblock %}
2 changes: 1 addition & 1 deletion src/templates/_utilities/diagnostics/pages/page.twig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
pageId: page.id,
elementType: elementQueryType.type
}) }}">
{{ create(elementQueryType.type).displayName }} Queries
{{ create(elementQueryType.type).displayName() }} Queries
</a>
</td>
<td>
Expand Down

0 comments on commit caf1bab

Please sign in to comment.