Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#234 closed defect (bug) (fixed)

Updating unchanged profile returns error but should simply redirect

Reported by: TigerDE2 Owned by: matt
Milestone: Priority: normal
Severity: trivial Version: 1.2
Component: Administration Keywords:
Focuses: Cc:


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)

#2 @deane
16 years ago

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.

#3 @matt
16 years ago

  • fixed_in_version set to 1.5
  • Owner changed from anonymous to matt
  • Resolution changed from 10 to 20
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.