diff --git a/composer.json b/composer.json index 773a872..1584be5 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mauricerenck/komments", - "version": "0.10.1", + "version": "0.10.2", "description": "A comment and webmention plugin for Kirby 3", "type": "kirby-plugin", "license": "MIT", diff --git a/package.json b/package.json index 5cd192b..f0f73cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "komments", - "version": "0.10.1", + "version": "0.10.2", "description": "A comment and webmention plugin for Kirby 3", "main": "index.js", "author": "Maurice Renck", diff --git a/snippets/webmentions-splitted.php b/snippets/webmentions-splitted.php index 71d0d1c..d1dc739 100644 --- a/snippets/webmentions-splitted.php +++ b/snippets/webmentions-splitted.php @@ -20,9 +20,11 @@ function addReply($komment) } } - foreach ($komments['replies'] as $komment) { - if ($page->hasQueuedKomments($komment['komment']->id(), $komment['komment']->status())) { - $kommentsInModeration++; + if (count($komments['replies']) > 0) { + foreach ($komments['replies'] as $komment) { + if ($page->hasQueuedKomments($komment['komment']->id(), $komment['komment']->status())) { + $kommentsInModeration++; + } } } ?> diff --git a/utils/base.php b/utils/base.php index c4cd3cb..02ba0c0 100644 --- a/utils/base.php +++ b/utils/base.php @@ -63,6 +63,8 @@ public function parseKomments($komments) public function buildTree($flatArray) { + $tree = []; + foreach ($flatArray as $key => $flat) { $nodes = []; $tree = [];