a-ok Posted August 15, 2017 Posted August 15, 2017 I'm defining some options in the Select Option fieldtype as follows: 1=Kalundborg Red 1035=Education Teal 1036=Living Orange 1037=Good Life Blue 1038=Careers Cyan However on saving the field it resets them to 1=Kalundborg Red 2=Education Teal 3=Living Orange 4=Good Life Blue 5=Careers Cyan Any reason why I cannot specify the unique ID to use?
szabesz Posted August 15, 2017 Posted August 15, 2017 According to the docs there should be no issue with it: "While we recommend letting the Options Fieldtype assign unique ID numbers for you, you may optionally assign your own. To do this, specify 123=title when adding a new option, where 123 is the ID number you wish to assign and title is the title text for your option." https://processwire.com/api/modules/select-options-fieldtype/#adding-new-options Also in the fieldtype_options table of database, option_id is int(10), so your numbers should work. Maybe a bug? 1
abdus Posted August 15, 2017 Posted August 15, 2017 I've just tried to assign custom integer values as @oma did, and I'm having the same issue. Once I submit, PW tries to delete former options as well. This is probably the intended behavior. and once I confirm to delete those options, I get unique incremential ids for the new options Checking the database entries, it seems value field isn't filled at all, instead option id is returned I'd say there's definitely a bug here. 1
a-ok Posted August 15, 2017 Author Posted August 15, 2017 17 minutes ago, szabesz said: According to the docs there should be no issue with it: "While we recommend letting the Options Fieldtype assign unique ID numbers for you, you may optionally assign your own. To do this, specify 123=title when adding a new option, where 123 is the ID number you wish to assign and title is the title text for your option." https://processwire.com/api/modules/select-options-fieldtype/#adding-new-options Also in the fieldtype_options table of database, option_id is int(10), so your numbers should work. Maybe a bug? Thanks for the help. Yeah... bizarre. I've always used 1, 2, 3, 4 etc but this time I needed higher values. I managed to edit the DB values directly and seemed to work fine so perhaps a bug as you say.
szabesz Posted August 15, 2017 Posted August 15, 2017 11 minutes ago, abdus said: PW tries to delete former options as well. I guess it is normal. IDs "cannot be edited". They get deleted first and afterwards new record is created. 1
Tom. Posted August 15, 2017 Posted August 15, 2017 Could you do? 1=1|Kalundborg Red 2=1035|Education Teal 3=1036|Living Orange 4=1037|Good Life Blue 5=1038|Careers Cyan Then you access it through $page->option->value 3
szabesz Posted August 15, 2017 Posted August 15, 2017 5 minutes ago, Tom. said: Could you do? It is just a workaround, isn't it? 1
Tom. Posted August 16, 2017 Posted August 16, 2017 17 hours ago, szabesz said: It is just a workaround, isn't it? Yeah, I was meaning until the bug is fixed. 2
a-ok Posted August 17, 2017 Author Posted August 17, 2017 Thanks for your help everyone. Should I report this bug on Github, or?
cstevensjr Posted August 17, 2017 Posted August 17, 2017 1 minute ago, oma said: Thanks for your help everyone. Should I report this bug on Github, or? Yes, please 2
szabesz Posted May 23, 2018 Posted May 23, 2018 It was fixed today, see: https://github.com/processwire/processwire-issues/issues/598 2
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