Opened 9 years ago
Closed 8 years ago
#234 closed defect (bug) (fixed)
Updating unchanged profile returns error but should simply redirect
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 1.2 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
If you open the profile screen and hit "Update Profile >>", you get the following:
ERROR: couldn't update your profile...
Instead, WP should simply redirect to the profile page, echoing sth. like "No changes occured, therefore, no changes were saved.", similar to what happens when pressing "Update Options >>" on the options screen without having changed anything on that page.
Change History (3)
Note: See
TracTickets for help on using
tickets.

I just ran into this and tracked down the source of the problem.
wpdb.query() (in wp-db.php) returns zero to indicate an error and otherwise returns the number of rows affected by the command. However, if an update does not actually change any values in a record, then MySQL will return 0 as the number of rows affected by the change. profile.php sees the zero and thinks that the update failed when it fact it was simply optimized away by MySQL as being redundant.