WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#25705 closed defect (bug) (fixed)

update_option regression in 3.7

Reported by: calin Owned by: nacin
Milestone: 3.7.1 Priority: normal
Severity: major Version: 3.7
Component: General Keywords: has-patch
Focuses: Cc:
PR Number:

Description

The update_option action in 3.7 is triggered after the option was saved to the DB not before as stated in the documentation or as the behavior was prior to 3.7.

Attachments (1)

update_option.diff (752 bytes) - added by calin 6 years ago.

Download all attachments as: .zip

Change History (6)

@calin
6 years ago

#1 @bpetty
6 years ago

  • Cc bpetty added
  • Milestone changed from Awaiting Review to 3.7.1

You're right, this hook should have been moved at the same time the DB query was in r25664, and is a regression from 3.6.

See #25015.

#2 @ocean90
6 years ago

delete_option and add_option are both before the db query, so update_option should be there too.

calin, how did you noticed this, any plugin which is broken now? Would be nice to know.

#3 @calin
6 years ago

Not any specific plugin.
I was looking over the code looking for a way to check options before they are commited to the DB.

#4 @nacin
6 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 25925:

In update_option(), call the update_option hook before the DB update.

Reverses a regression from [25664].

props calin.
fixes #25705 for trunk.

#5 @nacin
6 years ago

In 25926:

In update_option(), call the update_option hook before the DB update.

Merges [25925] to the 3.7 branch.

Reverses a regression from [25664].

props calin.
fixes #25705.

Note: See TracTickets for help on using tickets.