Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[Bug]Renaming fields in Collections #843
Changing the field name on an existing collection with data already stored does not rename the column but rather it stops indexing it and creates a new empty one.
The problems this proposes are the following:
There is no elegant way to solve this behavior for now. Someone has to write it...
Don't change the name and use the label instead. Or you could export your data, manipulate it and import it afterwards as a workaround.
Here are some thoughts about cleaning the database: #821
I faced the same issue and ended with a workaround on https://github.com/pauloamgomes/CockpitCMS-Helpers#better-handling-of-collection-and-singletons-structure-changes
the workaround works well and also provides a CLI command for updating all existing collection entries, however, is still an workaournd and think would be interesting to have that fixed in Cockpit himself. The challenging part is more on the collections (singletons are updated in a different way), the collection update() method performs an array merge between the new update data and the existing collection entry data and therefore the old values are not removed/updated. @aheinze could we have a force update method that is called from the collection entry edit and validates the collection data with the collection fields structure!?