Active
Project:
Bulk User Registration
Version:
8.x-1.1-beta1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
9 Mar 2021 at 19:26 UTC
Updated:
13 Nov 2024 at 14:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ryankavalsky commentedHere's the initial patch for review. Note: This patch applies to 8.x-1.x-dev, but you'll likely want to patch the newest release. See comment #3 below.
Comment #3
ryankavalsky commentedMy apologies - that patch was applied against 8.x-1.x-dev. This patch works for the newest release, 8.x-1.1-beta1.
Comment #4
ryankavalsky commentedComment #5
ryankavalsky commentedComment #6
ryankavalsky commentedDoes anybody know when this patch can be reviewed and merged?
Comment #7
sutharsan commentedI foresee that updating existing users can grow pretty complex from a UX point of view. What to do with existing data? Which fields to update and which not? Which field(s) to be the unique key? From a module maintenance point of view, I'd rather not go down this road.
Comment #8
richarddavies commentedWhoa, I've got a major case of déjà vu right now. I recently had the same need to update existing users with new roles and wrote a patch for this module to do that. I realized today I'd never submitted my patch and came here to do that. Imagine my surprise when I see that a new issue/patch now exists for that very same problem written about the same time as I was writing my patch!
Anyway, I'm going to add my +1 for this use case and include my patch for reference as well. As for the questions raised by Sutharsan, I took a very simple approach. It only allows updating the user's role (their username and email address are far less likely to ever change). You're already using the email address as the unique key to determine if a user already exists or not so I just used that same logic/key.
If we keep the scope limited to just updating roles, it doesn't really pose that many problems or challenges.
Comment #9
visway12 commentedI faced same kind of problem and added this patch. Added a custom hook like presave and postsave which will be invoked when user already exist while import.
Refer: https://www.drupal.org/project/bulk_user_registration/issues/3487248