fix: #13100, direct access to a tag page no longer excludes cid -1

This commit is contained in:
Julian Lam
2025-03-07 14:04:36 -05:00
parent fc64e89f7f
commit 14fd33ce8f

View File

@@ -27,7 +27,7 @@ tagsController.getTag = async function (req, res) {
breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[tags:tags]]', url: '/tags' }, { text: tag }]), breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[tags:tags]]', url: '/tags' }, { text: tag }]),
title: `[[pages:tag, ${tag}]]`, title: `[[pages:tag, ${tag}]]`,
}; };
let [settings, cids, categoryData, canPost, isPrivileged, rssToken, isFollowing] = await Promise.all([ const [settings, cids, categoryData, canPost, isPrivileged, rssToken, isFollowing] = await Promise.all([
user.getSettings(req.uid), user.getSettings(req.uid),
cid || categories.getCidsByPrivilege('categories:cid', req.uid, 'topics:read'), cid || categories.getCidsByPrivilege('categories:cid', req.uid, 'topics:read'),
helpers.getSelectedCategory(cid), helpers.getSelectedCategory(cid),
@@ -37,13 +37,6 @@ tagsController.getTag = async function (req, res) {
topics.isFollowingTag(req.params.tag, req.uid), topics.isFollowingTag(req.params.tag, req.uid),
]); ]);
// Explicitly exclude cid -1 if cid not specified
if (!cid) {
cids = new Set(cids);
cids.delete(-1);
cids = Array.from(cids);
}
const start = Math.max(0, (page - 1) * settings.topicsPerPage); const start = Math.max(0, (page - 1) * settings.topicsPerPage);
const stop = start + settings.topicsPerPage - 1; const stop = start + settings.topicsPerPage - 1;