From 6976925943ff12eedf34c543623872c4ed143e9e Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Wed, 1 Mar 2023 15:51:30 +0000 Subject: [PATCH 1/7] chore: incrementing version number - v2.8.7 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index a25c262ff1..f2788e81ea 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "2.8.6", + "version": "2.8.7", "homepage": "http://www.nodebb.org", "repository": { "type": "git", From 2ca38e7b9552d64cc074b751356a6781d6bd5923 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Wed, 1 Mar 2023 15:51:30 +0000 Subject: [PATCH 2/7] chore: update changelog for v2.8.7 --- CHANGELOG.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b053f14578..f43dc36832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,56 @@ +#### v2.8.7 (2023-03-01) + +##### Chores + +* incrementing version number - v2.8.6 (af6ce447) +* update changelog for v2.8.6 (f3306d03) +* incrementing version number - v2.8.5 (bff5ce2d) +* incrementing version number - v2.8.4 (a46b2bbc) +* incrementing version number - v2.8.3 (c20b20a7) +* incrementing version number - v2.8.2 (050e43f8) +* incrementing version number - v2.8.1 (727f879e) +* incrementing version number - v2.8.0 (8e77673d) +* incrementing version number - v2.7.0 (96cc0617) +* incrementing version number - v2.6.1 (7e52a7a5) +* incrementing version number - v2.6.0 (e7fcf482) +* incrementing version number - v2.5.8 (dec0e7de) +* incrementing version number - v2.5.7 (5836bf4a) +* incrementing version number - v2.5.6 (c7bd7dbf) +* incrementing version number - v2.5.5 (3509ed94) +* incrementing version number - v2.5.4 (e83260ca) +* incrementing version number - v2.5.3 (7e922936) +* incrementing version number - v2.5.2 (babcd17e) +* incrementing version number - v2.5.1 (ce3aa950) +* incrementing version number - v2.5.0 (01d276cb) +* incrementing version number - v2.4.5 (dd3e1a28) +* incrementing version number - v2.4.4 (d5525c87) +* incrementing version number - v2.4.3 (9c647c6c) +* incrementing version number - v2.4.2 (3aa7b855) +* incrementing version number - v2.4.1 (60cbd148) +* incrementing version number - v2.4.0 (4834cde3) +* incrementing version number - v2.3.1 (d2425942) +* incrementing version number - v2.3.0 (046ea120) + +##### Documentation Changes + +* update openapi spec to include info about passing in timestamps for topic creation, removing timestamp as valid request param for topic replying (40e7b86d) + +##### Bug Fixes + +* display 25 topics on category feed (79155109) +* object destructuring overwriting type parameter (ec58700f) +* alert on page load (8cf4a6f6) +* show error alert if password change fails (3bd9a871) +* update main post timestamp when rescheduling (edd2fc38) +* show admins/globalmods if content is purged (326b9268) +* email expiry timestamps (e335d0f6) +* #11259, clean old emails when updating via admin (#11260) (845c8013) +* #11257, onSuccessfulLogin called with improper uid (7a5bcc21) + +##### Tests + +* add dummy emailer hook in authentication test (1b29dbb6) + #### v2.8.6 (2023-02-03) ##### Chores From 8c762d3228ee622984a6eb4bad5cbec810c27e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 3 Mar 2023 09:30:51 -0500 Subject: [PATCH 3/7] fix: closes #11331, allow 0 length content if set to 0 in acp --- src/topics/create.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/topics/create.js b/src/topics/create.js index a6d63d53dd..8aacce42ca 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -82,9 +82,8 @@ module.exports = function (Topics) { data.title = String(data.title).trim(); data.tags = data.tags || []; - if (data.content) { - data.content = utils.rtrim(data.content); - } + data.content = String(data.content || '').trimEnd(); + Topics.checkTitle(data.title); await Topics.validateTags(data.tags, data.cid, uid); data.tags = await Topics.filterTags(data.tags, data.cid); @@ -167,9 +166,8 @@ module.exports = function (Topics) { data.cid = topicData.cid; await guestHandleValid(data); - if (data.content) { - data.content = utils.rtrim(data.content); - } + data.content = String(data.content || '').trimEnd(); + if (!data.fromQueue) { await user.isReadyToPost(uid, data.cid); Topics.checkContent(data.content); From f054a4f44d93326ba7d11c6338e135a3113da469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 6 Mar 2023 09:44:21 -0500 Subject: [PATCH 4/7] fix: get cid from pid instead of passing in --- public/src/client/topic/postTools.js | 2 +- src/socket.io/posts/tools.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js index e9b5602145..c9d57854b8 100644 --- a/public/src/client/topic/postTools.js +++ b/public/src/client/topic/postTools.js @@ -41,7 +41,7 @@ define('forum/topic/postTools', [ const pid = postEl.attr('data-pid'); const index = parseInt(postEl.attr('data-index'), 10); - socket.emit('posts.loadPostTools', { pid: pid, cid: ajaxify.data.cid }, async (err, data) => { + socket.emit('posts.loadPostTools', { pid: pid }, async (err, data) => { if (err) { return alerts.error(err); } diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.js index db6e432fa6..4ff69e7fc0 100644 --- a/src/socket.io/posts/tools.js +++ b/src/socket.io/posts/tools.js @@ -14,15 +14,15 @@ const utils = require('../../utils'); module.exports = function (SocketPosts) { SocketPosts.loadPostTools = async function (socket, data) { - if (!data || !data.pid || !data.cid) { + if (!data || !data.pid) { throw new Error('[[error:invalid-data]]'); } - + const cid = await posts.getCidByPid(data.pid); const results = await utils.promiseParallel({ posts: posts.getPostFields(data.pid, ['deleted', 'bookmarks', 'uid', 'ip', 'flagId']), isAdmin: user.isAdministrator(socket.uid), isGlobalMod: user.isGlobalModerator(socket.uid), - isModerator: user.isModerator(socket.uid, data.cid), + isModerator: user.isModerator(socket.uid, cid), canEdit: privileges.posts.canEdit(data.pid, socket.uid), canDelete: privileges.posts.canDelete(data.pid, socket.uid), canPurge: privileges.posts.canPurge(data.pid, socket.uid), From 1545223e7f00ef544a82d9afad7a54f1b1ccdcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 8 Mar 2023 18:28:55 -0500 Subject: [PATCH 5/7] fix: tag filtering when changing filter to watched topics or changing popular time limit to month --- src/topics/sorted.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/topics/sorted.js b/src/topics/sorted.js index af2cd344cb..7899a2f8d0 100644 --- a/src/topics/sorted.js +++ b/src/topics/sorted.js @@ -174,7 +174,7 @@ module.exports = function (Topics) { } tids = await privileges.topics.filterTids('topics:read', tids, uid); - let topicData = await Topics.getTopicsFields(tids, ['uid', 'tid', 'cid']); + let topicData = await Topics.getTopicsFields(tids, ['uid', 'tid', 'cid', 'tags']); const topicCids = _.uniq(topicData.map(topic => topic.cid)).filter(Boolean); async function getIgnoredCids() { @@ -192,11 +192,13 @@ module.exports = function (Topics) { topicData = filtered; const cids = params.cids && params.cids.map(String); + const { tags } = params; tids = topicData.filter(t => ( t && t.cid && !isCidIgnored[t.cid] && - (!cids || cids.includes(String(t.cid))) + (!cids || cids.includes(String(t.cid))) && + (!tags.length || tags.every(tag => t.tags.find(topicTag => topicTag.value === tag))) )).map(t => t.tid); const result = await plugins.hooks.fire('filter:topics.filterSortedTids', { tids: tids, params: params }); From 17d0b40efacff09664d011a2f4908d2a059239d4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 20 Oct 2022 21:59:29 -0400 Subject: [PATCH 6/7] fix: stop topic navigation hotkeys from firing if in a mousetrap-enabled form element --- public/src/client/topic.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index 961fcd74c3..8f0bf52f25 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -88,7 +88,11 @@ define('forum/topic', [ }); } - mousetrap.bind('j', () => { + mousetrap.bind('j', (e) => { + if (e.target.classList.contains('mousetrap')) { + return; + } + const index = navigator.getIndex(); const count = navigator.getCount(); if (index === count) { @@ -98,7 +102,11 @@ define('forum/topic', [ navigator.scrollToIndex(index, true, 0); }); - mousetrap.bind('k', () => { + mousetrap.bind('k', (e) => { + if (e.target.classList.contains('mousetrap')) { + return; + } + const index = navigator.getIndex(); if (index === 1) { return; From 22fc8fe38fd3b3c8ba6300ca6d12d90eb9b990ca Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 20 Oct 2022 21:59:29 -0400 Subject: [PATCH 7/7] fix: stop topic navigation hotkeys from firing if in a mousetrap-enabled form element