[eluser]tdktank59[/eluser]
[quote author="tdktank59" date="1266200165"]Hey
So ive got a small issue, that ive noticed before... as well.
When you try and save a single field it runs through the entire validation check and ends up error-ing out on fields that I don't care about at that point.
Is there a way we can either make this only check the passed in fields (best solution in my mind, and since then it only checks what we want it to.) Otherwise a way to define which validations to run for a specific insert.
Because im having an issue where ive got a few fields, for some reason or another a field gets blanked out and I try and update it again and it says cannot update because some other field is required that is blanked out as well.
Thanks.
[quote author="OverZealous" date="1266283645"]
@Oblique
@tdktank59
Either you are not loading the object before you are saving it, or you are setting individual fields to NULL after loading it. DMZ only checks and saves the columns that have not changed since the last
get or
save.[/quote][/quote]
@OverZealous
Here is what im doing that is causing the issue.
This is just a general ajax edit function
Basically Id send it the $field and the $value and a $user_id and the $table (user/user_info).
Based on all that it would load the $table, look up the user (id/user_id)
and save the $field and $value.
However it returns an error for a field that it should not be caring about, and clears the value out of $field.
The other field is set to require and due to this problem I'm stating, it removes the value on a failed update and then causes more problems.
Heres the code:
Code:
$u = new $table();
$u->where($column,$user_id)->get();
$u->{$field} = $value;
if ($u->save())