gallery module conflict with realname module
plan9 - February 21, 2009 - 23:59
| Project: | Gallery |
| Version: | 5.x-2.2 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
There is a serious problem between gallery module and realname module. Even if you disable full name support in gallery users settings - anytime a user updates their profile page somehow the realname username substitution feeds back to gallery and creates another account with the realname as the username. Apart from generating duplicate accounts in gallery it also breaks the drupal users connection with their original gallery - so suddenly their gallery folder is empty and nothing shows up on the image blocks on their Drupal profile page.

#1
This is worse than I thought. I've disabled realname module and the behaviour is still present. If a user changes just their username they lose their G2 album / account and a new one is generated in G2. I've checked the G2 database and it's filling up with new accounts which are just duplicate but with different usernames.
Am I missing something? isn't gallery module supposed to keep users in sync - even when they change account details?
If anyone has any info I'd really appreciate some help here!
#2
Just updating the title...
#3
OK - after exhaustive testing I can no categorically say that there is a conflict between the current stable releases of gallery and realname modules. More info here: http://drupal.org/node/367992#comment-1279566
#4
It's good then.
#5
No - it's still incompatible.
#6
This bug is also present in the dev version of the gallery module.
#7
Error log reports the following:
Type gallery
Date Saturday, 11 July, 2009 - 14:45
User Administrator
Location http://217.102.220.142/user/1176/edit
Referrer http://217.102.220.142/user/1176/edit
Message Error in function 'gallery_user_modify()' (gallery_user.inc:111):
• Error updating Gallery user (username changed)
Error (ERROR_LOCK_TIMEOUT) : /var/www/vhosts/mysite.com/gallery_data/locks/110713
• in modules/core/classes/FlockLockSystem.class at line 109 (GalleryCoreApi::error)
• in modules/core/classes/GalleryLockSystem.class at line 147 (FlockLockSystem::_acquireLock)
• in modules/core/classes/helpers/GalleryLockHelper_simple.class at line 176 (GalleryLockSystem::acquireWriteLock)
• in modules/core/classes/GalleryCoreApi.class at line 2291 (GalleryLockHelper_simple::acquireWriteLock)
• in modules/core/classes/GalleryEmbed.class at line 438 (GalleryCoreApi::acquireWriteLock)
• in /var/www/vhosts/mysite.com/httpdocs/sites/all/modules/gallery/gallery_user.inc at line 109 (GalleryEmbed::updateUser)
• in /var/www/vhosts/mysite.com/httpdocs/sites/all/modules/gallery/gallery_user.inc at line 69
• in /var/www/vhosts/mysite.com/httpdocs/sites/all/modules/gallery/gallery.module at line 243
• in /var/www/vhosts/mysite.com/httpdocs/modules/user/user.module at line 22
• in /var/www/vhosts/mysite.com/httpdocs/modules/user/user.module at line 111
• in /var/www/vhosts/mysite.com/httpdocs/modules/user/user.module at line 1525
• in ??? at line 0
• in /var/www/vhosts/mysite.com/httpdocs/includes/form.inc at line 430
• in /var/www/vhosts/mysite.com/httpdocs/includes/form.inc at line 258
• in /var/www/vhosts/mysite.com/httpdocs/includes/form.inc at line 80
• in ??? at line 0
• in /var/www/vhosts/mysite.com/httpdocs/includes/menu.inc at line 418
• in /var/www/vhosts/mysite.com/httpdocs/index.php at line 15
Severity error
Hostname 89.243.116.110
#8
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
#9
Just removing duplicate post.