blanco Posted April 22, 2021 Share Posted April 22, 2021 I have a select option were I try to add a new value with a specific id and title and getting this error message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Håbo kommun-114' for key 'title' The thing is that there are no other item in the list with that id nor title. It's a list of all the counties in sweden which has specific id numbers. There are 290 of them, and all of them gets imported except one, and that is Håbo kommun with the id number 0305. I can't even see anything in the database table fieldtype_options. there is no item with that id. What could be causing this? Thanks! Link to comment Share on other sites More sharing options...
wbmnfktr Posted April 22, 2021 Share Posted April 22, 2021 I played around with a fresh install of ProcessWire and tried to replicate your issue. There are a few things I found: the select/option ID needs to be unique (obviously) the select/option value can be the same between different options the select/option title needs to be unique as well While this works: 1=0305|Håbo kommun 114 A2=0305|Håbo kommun 114 B3=0305|Håbo kommun 114 C This doesn't: 1=0305|Håbo kommun 1142=0306|Håbo kommun 1143=0307|Håbo kommun 114 See the differences there? So... the easiest explanation would be that there at least one other entry with the same title. My testing setup looks like this: If you like drop me a PM and send me the list of all counties you have and I'll test it here. 1 Link to comment Share on other sites More sharing options...
a_dent Posted April 22, 2021 Share Posted April 22, 2021 @blanco could it be related to the Swedish characters? There should be one "Håbo kommun" and one "Habo kommun" in your list of Swedish municipalities. 1 Link to comment Share on other sites More sharing options...
blanco Posted April 26, 2021 Author Share Posted April 26, 2021 @wbmnfktr I have attached the complete list of all the entries. kommuner2.txt @a_dent I don't think so as that is not the only municipal with swedish characters ? [edit] Dude, you are probably correct! There is a "Habo kommun" in the list, I didn't even think about that! I'm gonna try and add it with a slightly different name. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now