It looks like you're new here. If you want to get involved, click one of these buttons!
hi, all,
i recently start to use fuel cms. in my requirement need a string as table primary key. like guid etc. when i develop the code, i found like the key value is 123a, list page no problem, edit page is ok too. but when i save the data, the key value will become to 123. anybody can tell me what happened. the cms can't use string as a primary key or need some config?
ths.
Comments
Tough to say what may be happening but it looks like it's trying to cast the ID value to be and int. A simple way to debug could be to use one of the model hook methods like "on_before_validate" or "on_before_save" to see if the value that is being prepped for save at those stages is correct:
http://docs.getfuelcms.com/general/models#hooks
Another option would be to have that key just be a unique indexed field on the table and you can specify in the model that column as a unique field to add validation for that.
Thanks for your reply admin! one thing need to confirm . in cms varchar as primary key is allow right? the cms have no limint about this?
Problem have been solved. add this codes to model config
then everything will be ok!
ths!!!