Skip to content

Commit

Permalink
Fix an error for form usage, when dealing with nested entries
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Nov 16, 2024
1 parent 1b35385 commit 658108e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/templates/forms/_panes/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% set render = not showDrafts and element.isDraft() ? false : render %}
{% set render = not showRevisions and element.isRevision() ? false : render %}

{% if element is instance of('craft\\elements\\Entry') or element is instance of('benf\\neo\\elements\\Block') %}
{% if (element is instance of('craft\\elements\\Entry') or element is instance of('benf\\neo\\elements\\Block')) and element.ownerId %}
{# Add a check here to ensure there's a valid owner (`getOwner()` will throw a hard-error) #}
{% set owner = craft.app.getElements().getElementById(element.ownerId, className(element), element.siteId) %}
{% set ownerField = craft.app.getFields().getFieldById(element.fieldId) %}
Expand Down

0 comments on commit 658108e

Please sign in to comment.