|
@@ -613,11 +613,15 @@ module.exports = function(crowi, app) {
|
|
|
const pages = await builder.query.lean().clone().exec('find');
|
|
const pages = await builder.query.lean().clone().exec('find');
|
|
|
|
|
|
|
|
if (pages.length >= 2) {
|
|
if (pages.length >= 2) {
|
|
|
- // Todo: remove empty pages if any. Immediately return if count of remaining pages are less than 2 after removal
|
|
|
|
|
|
|
|
|
|
// populate to list
|
|
// populate to list
|
|
|
builder.populateDataToList(User.USER_FIELDS_EXCEPT_CONFIDENTIAL);
|
|
builder.populateDataToList(User.USER_FIELDS_EXCEPT_CONFIDENTIAL);
|
|
|
- const identicalPathPages = await builder.query.lean().exec('find');
|
|
|
|
|
|
|
+ const pages = await builder.query.lean().exec('find');
|
|
|
|
|
+
|
|
|
|
|
+ // remove empty pages if any.
|
|
|
|
|
+ const identicalPathPages = pages.filter(p => !p.isEmpty);
|
|
|
|
|
+ // do nothing and return if count of remaining pages are less than 2 after removal
|
|
|
|
|
+ if (identicalPathPages.length < 2) return;
|
|
|
|
|
|
|
|
return res.render('layout-growi/identical-path-page', {
|
|
return res.render('layout-growi/identical-path-page', {
|
|
|
identicalPathPages,
|
|
identicalPathPages,
|