[wp-trac] [WordPress Trac] #35652: update_metadata() does twice as many loops through pre/post update actions as needed
WordPress Trac
noreply at wordpress.org
Fri Jan 29 04:38:56 UTC 2016
#35652: update_metadata() does twice as many loops through pre/post update actions
as needed
--------------------------+---------------------------
Reporter: Shelob9 | Owner: boonebgorges
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.5
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => assigned
* milestone: Awaiting Review => 4.5
Comment:
Yeah, this seems like a good change. There's a slight possibility for
breakage, because now if you have meta_ids `[1, 2, 3]`, the order of
actions fired will change.
Currently:
{{{
update_post_meta 1
update_post_meta 2
update_post_meta 3
update_postmeta 1
update_postmeta 2
update_postmeta 3
}}}
After the patch:
{{{
update_post_meta 1
update_postmeta 1
update_post_meta 2
update_postmeta 2
update_post_meta 3
update_postmeta 3
}}}
I'm having a hard time coming up with a scenario where this would cause a
real problem (in what scenarios is one legitimately using both hooks? and
in what percentage of those cases does order matter? sounds like a race
condition waiting to happen, even without the proposed change). But I want
to note it for the record.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35652#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list