ID fields breaking

edited December 2011 in Modules
Hi,
I've run into a few problems where fuel modifies the ID of a field, which either generates errors when it tries to retrieve it again, or causes a 404 when you try to edit the record again in the CMS (due to the ID being set to 0).
The first time it happened, it was because we had a table that didn't auto_increment, and so the SAVE query INSERT IGNORE INTO / ON DUPLICATE ENTRY UPDATE / LAST_INSERT_ID was failing, and 0ing out the ID field. This was fixed by setting the public $has_auto_increment variable to false in the model.
Now, we're running into another issue...we have another table that has a VARCHAR index based on ids given to us from another API. Some of them are strange (non alphanumeric). An ID like '0105_' is getting its 0 and _ stripped, and then fuel either throws an error or can't access the record again from the list view.
I've tried adding the ID to $hidden_fields and adding public $auto_validate = FALSE but it didn't work. I'm playing with CI->validator->remove_rule but don't know which validation rule is causing this (or where to find them). I found is_safe_character in validator_helper but that doesn't seem to be it. Any suggestions?
Thanks,
Jordan

Comments

Sign In or Register to comment.