From e80ba92d1b4e67b7299530e2068e89ce19f6665d Mon Sep 17 00:00:00 2001 From: Landon Reed Date: Mon, 23 Sep 2019 17:50:25 -0400 Subject: [PATCH] fix(GTFS+): always require GTFS+ yml on config init fix #486 --- lib/common/util/config.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/common/util/config.js b/lib/common/util/config.js index 583a05af0..822ee8517 100644 --- a/lib/common/util/config.js +++ b/lib/common/util/config.js @@ -83,11 +83,12 @@ function initializeConfig () { ...DEFAULT_CONFIG, ...JSON.parse(process.env.SETTINGS) } - if (config.modules.gtfsplus && config.modules.gtfsplus.enabled) { - // $FlowFixMe - assume file exists and make flow happy - const gtfsplus = require('../../../gtfsplus.yml') - config.specifications.gtfsplus = gtfsplus - } + // Note: The GTFS+ file should be required regardless of whether the module is + // enabled. Otherwise, it will not be loaded properly because the UI depends on + // the server config from the appinfo endpoint. + // $FlowFixMe - assume file exists and make flow happy + const gtfsplus = require('../../../gtfsplus.yml') + config.specifications.gtfsplus = gtfsplus // $FlowFixMe - assume file exists and make flow happy const gtfs = require('../../../gtfs.yml') config.specifications.gtfs = gtfs