Have you migrated your project from version 3 to version 4 and do you commonly have “reset” problems with your registration/editing form
After some time of research I found a possible solution!
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.
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.
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.
(I couldn’t decide what topic to post this thread on, so if I’m wrong please let me know)