From 6f16710191105657abbf4675bec8c0e98a3ed86e Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 4 Jun 2021 14:56:48 +0000 Subject: [PATCH] [Trunk | Admin Tools]: update_db.js: [Bug fix] Add Home page of communities by updating "portal" collection (not "community) | call "addHomePageInCommunities()" independently (not from other function). --- update_db.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update_db.js b/update_db.js index 9c79452..74d65a7 100644 --- a/update_db.js +++ b/update_db.js @@ -1734,7 +1734,6 @@ function addFooterDivIdForConnect() { function addFooterDivIdForCommunities() { // db.page.save({ "route" : "/", "name" : "Home", "type" : "other", "entities" : [ ], "portalType" : "community", "top" : false, "bottom" : false, "left" : false, "right" : false }); // print("page 'Home' added for communities"); - addHomePageInCommunities(); communityHomePageID = db.page.find({"portalType": "community", "route": "/"}).map( function(community) { return community._id.str; } ).toString(); db.divId.save({ "name" : "footer", "pages" : [ communityHomePageID ], "portalType" : "community" }); @@ -1751,7 +1750,7 @@ function addHomePageInCommunities() { community_pages[communityHomePageID] = true; community_pid = communities[i].pid; - db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}}); + db.portal.update({ "pid" : community_pid },{$set: { "pages": community_pages}}); print("Add home page with id " + communityHomePageID + " on community " + community_pid); } } @@ -1913,8 +1912,9 @@ use openaireconnect; // 03-06-2021 addFooterDivIdForConnect(); -addFooterDivIdForCommunities(); addFooterHelpTextForConnect(); +addHomePageInCommunities(); +addFooterDivIdForCommunities(); addFooterHelpTextForCommunities(); // 04-06-2021 debug helper function