Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#11627 closed defect (bug) (fixed)

parts of metadata API fail on user metadata

Reported by: wnorris's profile wnorris Owned by:
Milestone: 2.9.1 Priority: normal
Severity: major Version: 2.9
Component: General Keywords: has-patch
Focuses: Cc:

Description

two functions in the new metadata API reference the column named 'meta_id' directly, those are update_metadata and delete_metadata. In the usermeta table however, this column is actually named umeta_id. Using either of these two functions to update or delete user metadata results in a WordPress database error.

I think the best long term solution would be to rename this column to 'meta_id' so that it's consistent. However, I can imagine that would break a few plugins.

Attachments (2)

meta.diff (1.8 KB) - added by wnorris 15 years ago.
meta.no-function.diff (1.6 KB) - added by wnorris 15 years ago.

Download all attachments as: .zip

Change History (8)

@wnorris
15 years ago

#1 @dd32
15 years ago

  • Keywords db metadata removed
  • Milestone changed from 3.0 to 2.9.1

#2 @dd32
15 years ago

  • Keywords has-patch added; needs-patch removed

#3 @nacin
15 years ago

Looks good, though I think we should spare the unnecessary function and just do $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';.

#4 @wnorris
15 years ago

yeah, that's fine by me... I don't have strong feelings either way. Additional patch added that doesn't add the additional function.

#5 @ryan
15 years ago

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

(In [12563]) Use umeta_id for user meta. Props wnorris. fixes #11627 for 2.9

#6 @ryan
15 years ago

[12562] for trunk.

Note: See TracTickets for help on using tickets.