diff --git a/lib/hooks/views/res.view.js b/lib/hooks/views/res.view.js index 794e4f7fcb..95fccc8799 100644 --- a/lib/hooks/views/res.view.js +++ b/lib/hooks/views/res.view.js @@ -150,7 +150,9 @@ module.exports = function _addResViewMethod(req, res, next) { // Merge with config views locals if (sails.config.views.locals) { - _.merge(locals, sails.config.views.locals, _.defaults); + // Formerly a deep merge: `_.merge(locals, sails.config.views.locals, _.defaults);` + // Now shallow- see https://github.com/balderdashy/sails/issues/3500 + _.defaults(locals, sails.config.views.locals); } // If the path was specified, but invalid