0

I have build a Blog. Now I've tried to add the commenting function with "Comments": https://github.com/engram-design/Comments

I use the absolute basic template: https://github.com/engram-design/Comments/blob/master/examples/standard/standard.html

The call in my Tpl:

{% set params = {
   order: 'dateCreated asc'
} %}

{{ craft.comments.form(entry.id) }}

Until here everything is fine. When I want so send the comment, i always get this Error:

Property "Craft \ EntryModel.owner is undefined.

The "Comments" Plugin use EntryModel.owner when I want so submit a comment on any entry. Now the problem is that {{ entry.owner }} is undefined. But how can I define the {{ entry.owner }}?

I know this is a noobie Question, but how can I fix this?

2

Somewhere in your template you are trying to access the owner attribute on an EntryModel. The example above doesn't show any details on where you might be trying to do that in your templates.

Try commenting out any area of your template where you may be trying to output values that relate to the Entry Model. Maybe even comment out your whole template. Comment things out until you get your page to load again. As you mentioned this error occurs when you try to send a comment, you may also want to comment things out on whatever template gets loaded after you submit the comments.

Once you're getting the page to load without errors, add your code back line by line until you get the error. This will help you isolate where the error is.

When you find it, you'll probably need to add a conditional check to the offending code to get things working:

{% if entry['owner'] is defined %}
    Then it's safe to try to output {{ entry.owner }}
{% endif %}
| improve this answer | |
  • You are right. My Problem is that {{ entry.owner }} is undefined. But how can I define the {{ entry.owner }}? I don't use {{ entry.owner }} in my template. The "Comments" Plugin use EntryModel.owner when i want so submit a comment on any entry. – The Frog Oct 5 '16 at 16:45
  • 1
    I'm not familiar with the Comments plugin. I just downloaded it and searched for the word owner and it seems the only time it is used is when checking for something related to Matrix blocks: $element->owner->author when it tries to send an author notification email. Try disabling notifications if you have them enabled, and perhaps reach out to the author and file a bug report. – Ben Parizek Oct 5 '16 at 19:44
  • The problem is in the version you use, is a Bug with {{ entry.owner }}. – The Frog Oct 20 '16 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.