From 13850e35868199d70ccc9c2a954b40377e547131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 15 Jan 2018 13:22:59 -0500 Subject: [PATCH] fix categories not showing up in ACP dropdown if they are links --- src/categories.js | 6 +----- src/controllers/search.js | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/categories.js b/src/categories.js index 452762ae38..ab1d277e68 100644 --- a/src/categories.js +++ b/src/categories.js @@ -339,10 +339,6 @@ Categories.buildForSelect = function (uid, privilege, callback) { Categories.buildForSelectCategories = function (categories, callback) { function recursive(category, categoriesData, level, depth) { - if (category.link) { - return; - } - var bullet = level ? '• ' : ''; category.value = category.cid; category.level = level; @@ -358,7 +354,7 @@ Categories.buildForSelectCategories = function (categories, callback) { var categoriesData = []; categories = categories.filter(function (category) { - return category && !category.link && !parseInt(category.parentCid, 10); + return category && !parseInt(category.parentCid, 10); }); categories.forEach(function (category) { diff --git a/src/controllers/search.js b/src/controllers/search.js index f02a61dc31..49e762407a 100644 --- a/src/controllers/search.js +++ b/src/controllers/search.js @@ -54,6 +54,10 @@ searchController.search = function (req, res, next) { return next(err); } + results.categories = results.categories.filter(function (category) { + return category && !category.link; + }); + var categoriesData = [ { value: 'all', text: '[[unread:all_categories]]' }, { value: 'watched', text: '[[category:watched-categories]]' },