Ticket #234 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Updating unchanged profile returns error but should simply redirect

Reported by: TigerDE2 Assigned to: matt
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

08/23/04 08:19:51 changed by TigerDE2

11/29/04 20:00:03 changed by deane

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.

02/11/05 03:00:19 changed by matt

  • owner changed from anonymous to matt.
  • fixed_in_version set to 1.5.
  • status changed from new to closed.
  • resolution changed from 10 to 20.