﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
20285	Author meta fields aren't displaying correctly due to broken logic	FredWu	ryan	"Some authors have missing meta data even though the data are in the database. For example, some authors' description/biography are empty when retrieving them from `the_author_meta('description')`, even though `$authordata->description` from the function shows the data correctly.

This is caused by a bug in `wp-includes/author-template.php`, starting from line 99:

{{{
function get_the_author_meta($field = '', $user_id = false) {
	if ( ! $user_id )
		global $authordata;
	else
		$authordata = get_userdata( $user_id );

	var_dump($authordata);

	// Keys used as object vars cannot have dashes.
	$field = str_replace('-', '', $field);
	$field = strtolower($field);
	$user_field = ""user_$field"";

	if ( 'id' == $field )
		$value = isset($authordata->ID) ? (int)$authordata->ID : 0;
	elseif ( isset($authordata->$user_field) )
		$value = $authordata->$user_field;
	else
		$value = isset($authordata->$field) ? $authordata->$field : '';

	return apply_filters('get_the_author_' . $field, $value, $user_id);
}
}}}

`elseif ( isset($authordata->$user_field) )` is the problem, because for some users this field is set, but is empty, so the system never gets through to the real 'description' field.

I've attached a patch that fixes this."	defect (bug)	closed	high	3.4	Users	3.3.1	major	fixed	has-patch	scribu
