Assign Roles from CSV values
boabjohn - June 11, 2009 - 02:39
| Project: | User Import |
| Version: | 6.x-1.2 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
Sorry: I've read through some of the excellent ticket threads here, and searched, but can't seem to definitively confirm how the 6.x version is supposed to handle role imports?
My installation currently shows me no role selectors in the CSV field mapping stage, and instead asks me to simply tick one or more roles for the entire upload. My users all have one or more of a half dozen roles.
Someone mentioned that splitting the uploads into multiple files (one upload per role) would be a workaround, but if there's a more elegant approach I'd be really keen to hear about it!
JB

#1
Hello dev team...is there some illumination here? What would be involved in allowing the file/field mapping phase to be aware that one of the input columns is the role designator?
I'm dealing with fairly regular imports of hundreds of users, and they have various roles.
Is this in the dev roadmap?
If I have to pay a local devloper to hack the module code, would anyone like to have a forked version uploaded here?
#2
Let me know if you'd like to sponsor this feature being properly implemented in the User Import module.
#3
Thanks Robert: will have to let it pass unless someone else can join in .
#4
Hi, I also have a need for such a function - we need to be able to automatically inject a Drupal site with our student database, using the numerous course codes assigned to each student to create their roles. If it helps, I've come across a patch that's been made for Drupal 5 and have had a small degree of success implementing it into 6; field mapping is allowed, but the import ultimately just results in errors. The patch can be found here: http://drupal.org/node/171152
The error is: warning: array_push() [function.array-push]: First argument should be an array in /homepages/14/d294720235/htdocs/modules/user/user.module on line 249.
I'm just starting out with php & Drupal and have yet to get into permissions etc. so this is all beyond me I'm afraid. Have tried workarounds using rules with custom php, but my lame php knowledge results in random role allocations, and with all the necessary combinations I'd need, I imagine use of rules would be too query-intensive.
#5
In case you're still looking for a solution to this: http://drupal.org/node/171152 Just drop the system.inc file into user_import>supported... and it should work in Drupal 6, thanks to surge_martin's patch and nemcheck's help in that post. The .system file adds roles based on fields as well as mapping them across, so you don't even have to add the roles beforehand. This will save us days of manual inputting time at the college I work at; hope it helps.
#6
#7
http://drupal.org/node/171152