kendraio / kendra_home

Kendra Home
https://www.kendra.io
GNU General Public License v2.0
2 stars 2 forks source link

Bulk import/create users #23

Open iAugur opened 9 years ago

iAugur commented 9 years ago

Add the ability to bulk create users on Kendra_home Review available modules e.g. https://www.drupal.org/project/user_import

dahacouk commented 9 years ago

@iAugur Please can you check that this module allows for some sort of check to see if a user (email address) is already registered. I'm assuming it would but good to ask.

BBGuy commented 9 years ago

Created a new branch to test https://github.com/kendraio/kendra_home/tree/dev_27

BBGuy commented 9 years ago

To deploy

BBGuy commented 9 years ago

Tested the module on the test branch and:

The good

The bad

Next stage @dahacouk - if you can provide some data we can run a test - assigning to you and once you have data assign back to me

dahacouk commented 9 years ago

That's a shame that full name is not supported. All we have is email and full name. Anything we can do about this?

BBGuy commented 9 years ago

yes probably it doesn't do it out of the box but claims to be extensible. will investigate.

BBGuy commented 9 years ago

I managed to add support for the safeword field and full name is now importing, however the URL is not set from the safe value. Will investigate.

BBGuy commented 9 years ago

OK this my understanding about how the URL is set 1) set the full name field - Sets the safeword human 2) Safeword module sets the machine name from the human name 3) The real name module uses the full name field 4) The user:name-raw token in the URL pattern "users/[user:name-raw]" point at the real name.

user:name-raw: The raw login name of the user account, unprocessed by the RealName module.

so looks like real name is not triggering correctly or the data is not available to it when it does.

BBGuy commented 9 years ago

So looks like the machine name is not automatically set on entity update and is controlled by the UI. Looking at the Migrate implementation the machine name is set directly not derived from the name. so we have two options: 1) include a url-safe value to the field. 2) derive one in code.

BBGuy commented 9 years ago

Updated code with @iAugur function to set the machine name. Import now working.

BBGuy commented 9 years ago

All code is now live. Still to do -

BBGuy commented 9 years ago

import is now setup on live and using the flowing format

"user","password","email","full name","company","Job title"
"guy test 1","pita1","guytest1@blue-bag.com","Guy Schneerson test","blue-bag ltd","Drupl developer"
"guy test 2","pita2","guytest2@blue-bag.com","Guy Testerson","Range of vision","Musician"

@dahacouk - Can you review the fields in the above sample CSV snippet.

dahacouk commented 9 years ago

I guess we shouldn't have "company","Job title" fields.

BBGuy commented 9 years ago

Removed "company" & "Job title" from import

BBGuy commented 9 years ago

Tested and works with core update to 7.35 #37

BBGuy commented 9 years ago

one small issue with the import is we are getting a warning: Warning: Creating default object from empty value in _user_import_settings_save() (line 574 of /var/www/kendra/kendra-home/dev/htdocs/sites/all/modules/contrib/user_import/user_import.module). See issue https://www.drupal.org/node/2199415 However this is not visible to users and the import works so will not bother with for now.

BBGuy commented 9 years ago

Created two versions of the import 1) Activates the account and does not send email to user 2) sends a welcome email with a one time login link and user need to login and set their password before the account is activated.

BBGuy commented 9 years ago

The email format I used is:

Welcome to Kendra hub

To activate your account use the following one time login url:  !login_url

This link can only be used once to log in and will lead you to a page where you can set your password.

After setting your password, you will be able to log in at !login_uri in the future using:

username: !username
password: Your password

Kind regards,
The Kendra team
dahacouk commented 9 years ago

When Drupal sends out the email it is hard wrapped. I'd like it to be unwrapped or format=flowed. Please. Made another issue for this because it's a site wide problem. See #40

BBGuy commented 9 years ago

tested both user imports on live and both worked so only issue is the formatting.

dahacouk commented 9 years ago
dahacouk commented 9 years ago

@BBGuy I'm getting the error "Field Website is not supported" when I start a bulk user import – the 2 screen just after specifying the CSV file.

dahacouk commented 9 years ago

@BBGuy Errors don't seem to be viewable. Should they be? See:

dahacouk commented 9 years ago
dahacouk commented 9 years ago
iAugur commented 9 years ago

Patched VBO os the modify was causing an error for users: https://www.drupal.org/node/2305227

dahacouk commented 8 years ago

I'm assigning this issue to me as I reckon it is all done and will close this week after I have more time to review.