diff --git a/Changelog.md b/Changelog.md index 3e1b1d5..9acb47a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t ### Fixed - Fixed double-escaping of rendered HTML when nesting templates - Squashed a warning if the search index doesn't exist yet + - Fixed the stats updater if no pages in the system have tags yet ### Added - [Module API] Added new extra data system. See `parser-parsedown` and `page-edit` for an example. diff --git a/modules/page-list.php b/modules/page-list.php index ce856f3..a0e8e36 100644 --- a/modules/page-list.php +++ b/modules/page-list.php @@ -175,7 +175,7 @@ register_module([ $tag_counts[] = count($page_entry->tags ?? []); $result = new stdClass(); // value, state, completed - $result->value = round(array_sum($tag_counts) / count($tag_counts), 3); + $result->value = empty($tag_counts) ? -1 : round(array_sum($tag_counts) / count($tag_counts), 3); $result->completed = true; return $result; }