You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just noticed that somehow we got 2 fields in our project with the same handle (and all other settings, except for the group). I'm not sure how this happened, i think we messed something up in a merge. (I checked our config files, and it's there twice too)
But my point for this issue is that duplicate handles sound like a really bad time somewhere down the line. I guess the .yaml are taken as absolute truth. Not sure if there is any kind of validation in there, but it might be worthwhile to check for duplicate field handles before letting the user apply the config files?
Steps to reproduce
I haven't tried this, but this is what i imagine could force this issue
Duplicate one of the files in config\project\fields
Change the uid of the duplicated file
Apply config files to project
Additional info
Craft version: 3.6.11.2
PHP version: 7.4.12
Database driver & version: MySQL 5.7.26
Plugins & versions: irrelevant, i think
The text was updated successfully, but these errors were encountered:
Most likely happened as a result of a bad project config merge. You should be able to find out how it happened by looking at the Git history of config/project/. The YAML files are considered the source of truth, so any validation that needs to occur happens before the project config is modified / written out in the first place.
Yeah it’s problematic, since now if you delete one of those fields, Craft is going to delete the content column that they both currently share. (This will be resolved for new fields created after updating to Craft 3.7 thanks to column suffixes (#6922).)
If the change hasn’t hit production yet, then the best way to fix is to re-run through the project config environment setup instructions, and then carefully merge in any project config changes that have happened on dev environments since the last time production was updated.
Otherwise, try this:
Go into your content table and find the column that contains the correct data for the field. (Note that it may end in _old.)
Rename the column, giving it a _tmp suffix.
Delete or rename one of the two duplicate fields from the control panel.
Rename the *_tmp column back to whatever it really should be (e.g. field_theFieldHandle).
On other environments, either share a DB backup with them from the first environment, or go through a similar procedure – steps 1 and 2, then apply the incoming project config YAML produced by the first environment, then step 4.
Description
I just noticed that somehow we got 2 fields in our project with the same handle (and all other settings, except for the group). I'm not sure how this happened, i think we messed something up in a merge. (I checked our config files, and it's there twice too)
But my point for this issue is that duplicate handles sound like a really bad time somewhere down the line. I guess the .yaml are taken as absolute truth. Not sure if there is any kind of validation in there, but it might be worthwhile to check for duplicate field handles before letting the user apply the config files?
Steps to reproduce
I haven't tried this, but this is what i imagine could force this issue
Additional info
The text was updated successfully, but these errors were encountered: