﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
13267	get_metadata() is breaking assoc arrays	apeatling	ryan	"I'm doing some work with the new update/delete/get_user_meta() functions and noticed that associative arrays are breaking. The returned array from get_user_meta() is always returning on a level below where it should be. The problem is compounded if you try and fetch existing values and then update.

From what I can see, the issue stems from the get_metadata() function.

Here's some code that highlights the problem, activate it and refresh the page a few times:


{{{
<?php
/*
Plugin Name: Usermeta Test
*/

function usermeta_test() {
	global $current_user;

	if ( empty( $current_user->ID ) )
		return false;

	$old_from_db = get_user_meta( $current_user->ID, 'um_test_old' );
	$new_from_db = get_usermeta( $current_user->ID, 'um_test_new' );

	$old_from_db['foo'][] = true;
	$new_from_db['foo'][] = true;

	update_user_meta( $current_user->ID, 'um_test_old', $old_from_db );
	update_usermeta( $current_user->ID, 'um_test_new', $new_from_db );

	var_dump( $old_from_db, $new_from_db );
}
add_action( 'init', 'usermeta_test' );
?>
}}}

I don't have a patch yet, I wanted to get the ticket up first.
"	defect (bug)	closed	high		Database	3.0	blocker	invalid		
