grav-plugin-comments icon indicating copy to clipboard operation
grav-plugin-comments copied to clipboard

[Error] Creating default object from empty value

Open Heraes-git opened this issue 7 years ago • 5 comments

Having freshly installed and configured the plugin (copied the yaml in /config/plugin), I have this critkey error :

2019-03-29_00h43m09s_chrome

My setup is :

  • A regular page "commentaires.fr.md" with, in frontmatter :
---
title: Commentaires
visible: true
---
  • A template commentaires.html.twig, with :
{% extends 'partials/base.html.twig' %}
{% block content %}
    {% set tag = page.header.user_htmltag|defined('div') %}
    <{{ tag }} class="{{ page.header.user_classes }}">
        {{ page.content }}
        {% include 'partials/comments.html.twig' with {'page': page} %}
    </{{ tag }}>
{% endblock %}

I enabled the plugin for the pages :

enable_on_routes:
  - '/blog'
  - '/critiques'
  - '/commentaires'

Heraes-git avatar Mar 28 '19 23:03 Heraes-git

I'm not familiar with this plugin as Flavio wrote it. When Grav 1.6 is released, we can go back and see about fixing issues on it. Sorry for the delay.

rhukster avatar Mar 29 '19 01:03 rhukster

To me, it looks like $header could be null.

mahagr avatar Mar 29 '19 11:03 mahagr

@rhukster A big thank you for the quick answer. I thought the plugin was abandoned, but I see that there's still people involved on it (and this is important, given the utility of this plugin). I will be patient. ;) For now, I think I'm gonna disable the plugin and wait for a fix.

Heraes-git avatar Mar 29 '19 13:03 Heraes-git

@rhukster Now that Grav 1.6 is out, can the team take a look at this plugin? I'd like to use it, but it seems like many are having issues because it's outdated.

lou-diamonds avatar Jun 06 '19 13:06 lou-diamonds

I'm testing this with 1.6 and 1.7 and PHP 7.4 and don't see this error any more.

rhukster avatar Sep 10 '20 21:09 rhukster