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.
I'm using LDAP integration to provide LDAP auth for my drupal website and have a module that automatically generates a content profile for every new drupal account that looks like this:
function wand_account_user($op, &$edit, &$account, $category = NULL) {
// Create a content profile whenever user is created (via LDAP)
if ($op == 'insert') {
$node = new StdClass();
$node->type = 'profile';
$node->title = $account->name;
$node->created = time();
$node->changed = $node->created;
$node->uid = $account->uid;
watchdog('Created Profile for user' . $account->uid, 'Created a Profile node for user ' . $account->uid . ' via wand_account.module');
node_save($node);
}
}
However when I go to edit this content profile either by logging into the user and altering the profile, or editing it through the admin user list after it has been created I get the following error in drupal: "This content has been modified by another user, changes cannot be saved.". If I edit the profile from the content list in the admin panel in drupal it works fine also. Any ideas?
Comments
Comment #1
mdeltito CreditAttribution: mdeltito commentedI believe I had the same issue, though I'm not certain as it was quite some time ago. Looking at the code I wrote for this functionality, I did some shuffling of the $user variable which may be of interest: