There is a conflict with gallery which results in duplicate users accounts in gallery - and, during a gallery - Drupal user sync, can also create duplicate Drupal accounts.

More info here: http://drupal.org/node/367992#comment-1279566

I've also reported this to the gallery issues queue.

Comments

NancyDru’s picture

Priority: Critical » Normal

I don't have Gallery, so I can't test this. I do know that Realname does not create accounts, so that part of the problem is elsewhere.

NancyDru’s picture

Status: Active » Postponed (maintainer needs more info)

Can you post a link to the Gallery issue so I can track it, please.

plan9’s picture

Hi

I made a report to the gallery queue here: http://drupal.org/node/379622#comment-1279588

NancyDru’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks

NancyDru’s picture

Status: Active » Postponed

watching that issue

plan9’s picture

I've identified which line of code is causing the problem:

Line 103: $account->name = $account->realname;

From:

 /**
 * Implementation of hook_user().
 */
function realname_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'load') {
    $account->realname = realname_make_name($account);

    // If theme then replace name with realname.
    if (variable_get('realname_theme', FALSE) && $account->realname) {
      //Store it for places where it needed
      if (!isset($account->realname_save) && is_object($account)) {
        $account->realname_save = $account->name;
        $account->name = $account->realname;
      }
    }
  }
//  else {
//     drupal_set_message("hook_user($op)");
//  }
} 

I've noticed that in the dev version of realname module this line of code has been commented out which does fix the gallery bug but also removes the realnames from user profiles.

plan9’s picture

When I say user profiles I mean user pages as in this issue: http://drupal.org/node/369183

plan9’s picture

Hi Nancy

I've found the code in gallery that is causing the conflict with realname. It's in gallery/gallery.inc lines 59 - 74


  // Username is about to change
  if ($namechange = (isset($edit['name']) && ($edit['name'] != $user->name))) {
    // Make sure the original user is up to date
    gallery_user_modify($user, 'update', TRUE);
  }
  
  $user->name = isset($edit['name']) ? $edit['name'] : $user->name;
  
  if ($namechange) {
    // Change username
    gallery_user_modify($user, 'username');
  }
  else {
    // Update user
    gallery_user_modify($user, 'update', TRUE);
  }

If I comment out this code and update a user profile in Drupal the problem appears to be fixed - however in gallery corresponding user accounts details are no longer being updated. So I'm guessing the problem is with gallery module using $user->name; and this being intercepted by realname. The duplicate accounts that are being generated through a mis-synch all have a realname as their username.

Any hints / tips would be really appreciated.

G

hass’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Branch is no longer supported.