diff --git a/core/server/services/labs.js b/core/server/services/labs.js index 260185d2e8..7391f0d974 100644 --- a/core/server/services/labs.js +++ b/core/server/services/labs.js @@ -1,11 +1,18 @@ -var settingsCache = require('./settings/cache'), - _ = require('lodash'), - Promise = require('bluebird'), - SafeString = require('./themes/engine').SafeString, - common = require('../lib/common'), - labs = module.exports = {}; +const settingsCache = require('./settings/cache'); +const _ = require('lodash'); +const Promise = require('bluebird'); +const SafeString = require('./themes/engine').SafeString; +const common = require('../lib/common'); +const config = require('../config'); +let labs = module.exports = {}; labs.isSet = function isSet(flag) { + /** + * TODO: Uses hard-check for members prototype, removed here when added to settings + */ + if (flag === 'members' && config.get('enableDeveloperExperiments')) { + return true; + } var labsConfig = settingsCache.get('labs'); return labsConfig && labsConfig[flag] && labsConfig[flag] === true; }; diff --git a/core/server/services/themes/middleware.js b/core/server/services/themes/middleware.js index ef385e73bb..01f09f9082 100644 --- a/core/server/services/themes/middleware.js +++ b/core/server/services/themes/middleware.js @@ -60,6 +60,15 @@ themeMiddleware.updateTemplateData = function updateTemplateData(req, res, next) labsData = _.cloneDeep(settingsCache.get('labs')), themeData = {}; + /** + * TODO: Uses hard-check for members prototype, removed here when added to settings + */ + if (config.get('enableDeveloperExperiments')) { + Object.assign(labsData, { + members: true + }); + } + if (activeTheme.get()) { themeData.posts_per_page = activeTheme.get().config('posts_per_page'); }