Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello, I have seen how the "Counter for og_users_roles table " is used an it's a very bad practice that is non atomical :
when a role is assigned to a user for a group the following code is used :
$ogr_id = variable_get('og_user_roles_counter', 0) + 1;
variable_set('og_user_roles_counter', $ogr_id);
db_query("INSERT INTO {og_users_roles} (uid, rid, gid, ogr_id) VALUES (%d, %d, %d, %d)", $uid, $rid, $gid, $ogr_id);
which can lead to have 2 rows with the same $ogr_id if the site is under heavy load.
Why not used an auto-increment field ?
David
Comments
Comment #1
SomebodySysop CreditAttribution: SomebodySysop commentedGood idea. I'll look into it. Have to figure out how to upgrade existing tables while accomplishing this. Thanks.
Comment #2
TechSteve CreditAttribution: TechSteve commentedI also doubt about this variable. I'm writing some program to set the user roles on the fly and find that this variable is set when assigning roles to group nodes in the module. However, it seems that the only use is to show the number on the '/admin/og/og_user_roles/settings' page. Is there anybody know why this variable is there or any usage would be implemented in the future? Thanks.
Cheers,
Steve
Comment #3
sunWith the rise of the rewritten OGUR 4.x for Drupal 6, in which many unrelated features of OGUR were removed, and nearing a release of Drupal 7, I'm closing down old issues.
Comment #4
SomebodySysop CreditAttribution: SomebodySysop commentedThe person who changed the status of these issues to "won't fix" was not authorized to do so: http://drupal.org/node/352139#comment-2352234
OGUR 6.x-1.x will continue to be maintained by me.