[wp-trac] [WordPress Trac] #28315: update_user_meta() updates user with ID1 if WP_Error is passed as first argument

WordPress Trac noreply at wordpress.org
Fri Aug 1 19:58:54 UTC 2014


#28315: update_user_meta() updates user with ID1 if WP_Error is passed as first
argument
--------------------------------+-----------------------------
 Reporter:  javorszky           |       Owner:  wonderboymusic
     Type:  defect (bug)        |      Status:  reopened
 Priority:  normal              |   Milestone:  4.0
Component:  Options, Meta APIs  |     Version:  3.9.1
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:
--------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 [attachment:28315.2.diff] causes two unit test failures:
 {{{
 1) Tests_Post_Meta::test_nonunique_postmeta
 Failed asserting that false is true.

 S:\home\wordpress\develop\tests\phpunit\tests\post\meta.php:98

 2) Tests_Post_Meta::test_delete_post_meta_by_key
 Failed asserting that false is true.

 S:\home\wordpress\develop\tests\phpunit\tests\post\meta.php:156
 }}}

 `delete_metadata()` can accept `null` or `false` if `$delete_all` is true,
 see [source:tags/3.9.1/src/wp-includes/post.php#L1839
 delete_post_meta_by_key()].

 [attachment:28315.3.diff] takes that into account and fixes the failures.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28315#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list