From b63bc98e0fd5ef30582c7f6e45ff59667bcfecbd Mon Sep 17 00:00:00 2001 From: Jesse Woo Date: Wed, 28 Aug 2024 15:17:02 -0700 Subject: [PATCH] fixing nesting issues --- core/components/com_forum/site/assets/js/like.js | 4 +--- .../components/com_forum/site/views/threads/tmpl/_comment.php | 1 + core/components/com_forum/site/views/threads/tmpl/_list.php | 1 + core/plugins/groups/forum/assets/js/like.js | 4 ---- core/plugins/groups/forum/views/threads/tmpl/_comment.php | 1 + core/plugins/groups/forum/views/threads/tmpl/_list.php | 1 + 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/components/com_forum/site/assets/js/like.js b/core/components/com_forum/site/assets/js/like.js index c6062ba4f9..9ac2b24417 100644 --- a/core/components/com_forum/site/assets/js/like.js +++ b/core/components/com_forum/site/assets/js/like.js @@ -1,5 +1,3 @@ -console.log("like on site forum"); - window.addEventListener('DOMContentLoaded', (domEvent) => { // Find all the "like" button const likeButton = document.querySelectorAll('.comment-body .like') @@ -17,7 +15,7 @@ window.addEventListener('DOMContentLoaded', (domEvent) => { const likesList = likeButton[i].dataset.likesList; const likeCount = likeButton[i].dataset.count; - console.log(threadId, postId, userId, likeCount, userName, likesList); + // console.log(threadId, postId, userId, likeCount, userName, likesList); const likesListArray = likesList.split("/"); diff --git a/core/components/com_forum/site/views/threads/tmpl/_comment.php b/core/components/com_forum/site/views/threads/tmpl/_comment.php index f3c523a265..17f54a09b6 100644 --- a/core/components/com_forum/site/views/threads/tmpl/_comment.php +++ b/core/components/com_forum/site/views/threads/tmpl/_comment.php @@ -257,6 +257,7 @@ ->set('controller', $this->controller) ->set('comments', $this->comment->get('replies')) ->set('thread', $this->thread) + ->set('likes', $this->likes) ->set('parent', $this->comment->get('id')) ->set('config', $this->config) ->set('depth', $this->depth) diff --git a/core/components/com_forum/site/views/threads/tmpl/_list.php b/core/components/com_forum/site/views/threads/tmpl/_list.php index fe3e4a3807..8af8e53411 100644 --- a/core/components/com_forum/site/views/threads/tmpl/_list.php +++ b/core/components/com_forum/site/views/threads/tmpl/_list.php @@ -47,6 +47,7 @@ ->set('controller', $this->controller) ->set('comment', $comment) ->set('like', $likesByPostId) + ->set('likes', $this->likes) ->set('thread', $this->thread) ->set('config', $this->config) ->set('depth', $this->depth) diff --git a/core/plugins/groups/forum/assets/js/like.js b/core/plugins/groups/forum/assets/js/like.js index 119071d562..0ea5dbed53 100644 --- a/core/plugins/groups/forum/assets/js/like.js +++ b/core/plugins/groups/forum/assets/js/like.js @@ -1,5 +1,3 @@ -console.log("like on GROUP forum"); - window.addEventListener('DOMContentLoaded', (domEvent) => { // Find all the "like" button const likeButton = document.querySelectorAll('.comment-body .like') @@ -17,8 +15,6 @@ window.addEventListener('DOMContentLoaded', (domEvent) => { const likesList = likeButton[i].dataset.likesList; const likeCount = likeButton[i].dataset.count; - console.log(threadId, postId, userId, likeCount, userName, likesList); - const likesListArray = likesList.split("/"); if (hasHeart) { diff --git a/core/plugins/groups/forum/views/threads/tmpl/_comment.php b/core/plugins/groups/forum/views/threads/tmpl/_comment.php index e23930959d..4150829a90 100644 --- a/core/plugins/groups/forum/views/threads/tmpl/_comment.php +++ b/core/plugins/groups/forum/views/threads/tmpl/_comment.php @@ -255,6 +255,7 @@ ->set('group', $this->group) ->set('comments', $this->comment->get('replies')) ->set('thread', $this->thread) + ->set('likes', $this->likes) ->set('parent', $this->comment->get('id')) ->set('config', $this->config) ->set('depth', $this->depth) diff --git a/core/plugins/groups/forum/views/threads/tmpl/_list.php b/core/plugins/groups/forum/views/threads/tmpl/_list.php index 96cd6c24dd..bc30edba6c 100644 --- a/core/plugins/groups/forum/views/threads/tmpl/_list.php +++ b/core/plugins/groups/forum/views/threads/tmpl/_list.php @@ -47,6 +47,7 @@ ->set('group', $this->group) ->set('comment', $comment) ->set('like', $likesByPostId) + ->set('likes', $this->likes) ->set('thread', $this->thread) ->set('config', $this->config) ->set('depth', $this->depth)