Content Manager - Customize view (create/edit form) reseting? Here is the solution

Have you migrated your project from version 3 to version 4 and do you commonly have “reset” problems with your registration/editing form :question:
After some time of research I found a possible solution!

:scream: History of horror(error) .

  • In version 3 of strapi, form configurations (edit view) were saved in the “core_store” table. Today in version 4 it is being saved in the “strapi_core_store_settings” table.
  • So far everything is fine, but with the database migration script, the old settings were also imported, from the old table to the new one.
  • “Oh… Ok” you must be thinking… but in the old values (v3) the names of the content types were used in PLURAL, instead of what we have today where they are used in SINGULAR (v4). Which causes the creation of another row in the database.

:thinking: How did the error work in practice? (running code).

  • When building/start/develop the project, it uses the first content-type reference found, in this case “apps.apps”.
  • When editing, it considers the key with “app.app”, as this is the correct one from a code point of view (singular), and from then on it only uses this key to display.
  • When rebuilding/redeploying the project on the server, it will get whatever comes first, in this case, the old line, “apps.apps”.
  • Replacing all your editing and “resetting” the labels and ordering form

It may sound crazy, but it took away a few nights of sleep and months with that flea behind my ear.

:saluting_face: Solution.
Look for the line in which the “key” column contains the content-type in plural and delete it, leaving only the line with the content-type in singular.

I hope this post can help some developer, as I really didn’t find anything here on the forum, strapi docs v3/v4, google, reddit, etc about this problem. And because it is a v3 to v4 migration, it is something very specific.

See ya :smile:

(I couldn’t decide what topic to post this thread on, so if I’m wrong please let me know)

2 Likes

You made my day!

To assist with discoverability of this fix on search engines, let me add some keywords:

Configure the view resets
Strapi content type view configuration issue
Fix Strapi server restart view reset
Strapi view settings lost after restart
Solving Strapi view configuration reset
Persistent view configuration in Strapi
Avoid Strapi view reset on server reboot
Strapi content type settings not saving
Permanent fix for Strapi view reset problem
How to maintain Strapi view settings post-restart
Troubleshooting Strapi server restart issues
Strapi configuration persistence
Prevent Strapi configuration loss
Strapi server restart configuration tips
Guide to fixing Strapi view reset after restart