Bug when node title of content profile is set as real name.

This happens on pages displaying with multiple node and their authors. For example:
admin/content/node
or search results

The first node author user ID is replaced by node title instead of profile title. The other nodes appear fine. This is because of an incorrect check to see if profile is loaded or not on realname.module line 789:

if ($fields) {
// Has the profile been loaded?
if (!isset($account->{key($fields)})) {
$load_func = $module . '_load_profile';

The highlighted condition is false the first time, because key returns 'title' which is found in account as the node title. As $fields is static, this statement returns true subsequently.

It needs to be solved with a proper check:

Set a variable on realname_content_profile.inc line 45 to show that profile is loaded and then check for it.

function content_profile_load_profile(&$account, $type = NULL) {
...

$account->title = $profile->title; // http://drupal.org/node/606364
$account->content_profile_loaded = 1;

}

realname.module line 789:

if ($fields) {
// Has the profile been loaded?
if (!$account->content_profile_loaded) {
$load_func = $module . '_load_profile';

Comments

harryster’s picture

Issue summary: View changes
hass’s picture

Status: Needs review » Closed (outdated)