From 1fce5221bb8b53f95cd78d835b489711933460f5 Mon Sep 17 00:00:00 2001 From: Javier Castro Date: Thu, 25 Oct 2018 15:05:44 -0300 Subject: [PATCH] Fix #2186: Content Manager sends me to blank page --- .../config/functions/bootstrap.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/strapi-plugin-content-manager/config/functions/bootstrap.js b/packages/strapi-plugin-content-manager/config/functions/bootstrap.js index 67a28900b3..e7411211a9 100644 --- a/packages/strapi-plugin-content-manager/config/functions/bootstrap.js +++ b/packages/strapi-plugin-content-manager/config/functions/bootstrap.js @@ -291,6 +291,15 @@ module.exports = async cb => { // Update the displayed fields const updatedListDisplay = prevListDisplay.filter(obj => obj.name !== currentAttr.join()); + // Retrieve the model's displayed fields for the `EditPage` + const fieldsPath = getEditDisplayFieldsPath(attrPath); + // Retrieve the previous settings + const prevEditDisplayFields = _.get(prevSchema.models, fieldsPath); + // Update the fields + const updatedEditDisplayFields = prevEditDisplayFields.filter(field => field !== currentAttr.join()); + // Set the new layout + _.set(prevSchema.models, fieldsPath, updatedEditDisplayFields); + if (updatedListDisplay.length === 0) { // Update it with the one from the generated schema _.set(prevSchema.models, listDisplayPath, _.get(schema.models, listDisplayPath, []));