mirror of
https://github.com/strapi/strapi.git
synced 2025-10-29 00:49:49 +00:00
Fix #2186: Content Manager sends me to blank page
This commit is contained in:
parent
74249729e2
commit
1fce5221bb
@ -291,6 +291,15 @@ module.exports = async cb => {
|
|||||||
// Update the displayed fields
|
// Update the displayed fields
|
||||||
const updatedListDisplay = prevListDisplay.filter(obj => obj.name !== currentAttr.join());
|
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) {
|
if (updatedListDisplay.length === 0) {
|
||||||
// Update it with the one from the generated schema
|
// Update it with the one from the generated schema
|
||||||
_.set(prevSchema.models, listDisplayPath, _.get(schema.models, listDisplayPath, []));
|
_.set(prevSchema.models, listDisplayPath, _.get(schema.models, listDisplayPath, []));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user