From 2c6bf754d5b55b50638d23e6f0affc338c8c09a2 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 10 May 2021 18:59:09 -0400 Subject: [PATCH] Fix undefined variables in wall_thread.tpl - Remove unused "num_comments_text" template variable - Remove unused "item.postops" template variable mention --- src/Model/Item.php | 3 ++- src/Object/Post.php | 7 +++---- view/theme/vier/templates/wall_thread.tpl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 64bd266c8..ab99e8c1a 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3020,7 +3020,7 @@ class Item ]; if (!empty($item['plink'])) { - $ret["href"] = DI::baseUrl()->remove($item['plink']); + $ret['href'] = DI::baseUrl()->remove($item['plink']); $ret["title"] = DI::l10n()->t('link to source'); } } elseif (!empty($item['plink']) && ($item['private'] != self::PRIVATE)) { @@ -3028,6 +3028,7 @@ class Item 'href' => $item['plink'], 'orig' => $item['plink'], 'title' => DI::l10n()->t('link to source'), + 'orig_title' => DI::l10n()->t('Link to source'), ]; } else { $ret = []; diff --git a/src/Object/Post.php b/src/Object/Post.php index 6973fd236..7bd3bcefb 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -427,6 +427,8 @@ class Post $tmp_item = [ 'template' => $this->getTemplate(), 'type' => implode("", array_slice(explode("/", $item['verb']), -1)), + 'comment_firstcollapsed' => false, + 'comment_lastcollapsed' => false, 'suppress_tags' => DI::config()->get('system', 'suppress_tags'), 'tags' => $tags['tags'], 'hashtags' => $tags['hashtags'], @@ -543,10 +545,7 @@ class Post } } - if ($this->isToplevel()) { - $result['total_comments_num'] = "$total_children"; - $result['total_comments_text'] = DI::l10n()->tt('comment', 'comments', $total_children); - } + $result['total_comments_num'] = $this->isToplevel() ? $total_children : 0; $result['private'] = $item['private']; $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : ''); diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl index f5e13137a..36e26b0a5 100644 --- a/view/theme/vier/templates/wall_thread.tpl +++ b/view/theme/vier/templates/wall_thread.tpl @@ -155,7 +155,7 @@ {{/if}} -
{{$item.location_html nofilter}} {{$item.postopts}}
+
{{$item.location_html nofilter}}