Closed markstreich closed 11 years ago
a really simple solution is to refresh the $account_detail object after the update. you can do this either by querying the database again or directly updating the object in php.
i.e. $data['account_detail']->firstname = $this->input->post('settings_firstname');
your proposed solution doesnt really work right... if i set EVERY field to empty... then it will fail too haha. cuz' you're assuming something else wont be empty.
Yeah I'm a newb to CI, I have no idea what the best solution is, but if you set every field blank it will error because email is required.
Hi,
I'm using A3M as my intro to CI. Thank you for the awesome platform to work with and learn from!
Here's a small issue. I think I understand what's happening but I'm not comfortable enough with the language to feel like I fixed it correctly.
If you have an account setting already with a value, first name as an example, and then change the value to empty, it updates the database but the input value on the resulting page will retain the old value. If you refresh the page, it is empty, but it appears to the user as if it wasn't updated.
This is because the account_settings view (line 46) checks set_value('settings_firstname') to determine if it should show the set_value, but after setting it to empty that variable is null, so it uses $account_details->firstname instead, which was queried before the database update.
This seems to work, but not sure if it's ideal: