Closed (fixed)
Project:
Node import
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2008 at 07:55 UTC
Updated:
2 May 2008 at 14:14 UTC
1. I would like to be able to assign ownership of imported nodes with imported email addresses.
2. I have an untested patch for node_import.module (v 1.50.2.3.2.13) here: http://drupal.pastebin.org/28418
3. The node import module queries the users table with email addresses to retrieve the uids for ownership.
4. Is there a function that can be used in place of db_query?
5. Is there a better way to accomplish my objective?
6. Can the patch be improved in some obvious way?
7. If I can get this to work I will submit it for a patch to be ported.
Comments
Comment #1
Robrecht Jacques commentedThe code you are changing is only for raw input (in which case the $type == 'node_import').
It is useful to to map a user using the email address in other places as well. There is a function called "node_import_userreference()" which is defined for that. Currently it only checks whether the value passed is an integer (in which case the uid is assumed) or if not, whether the string equals to the name of a user. We could extend this function to also look if the string passed matches an email.
This may be a patch, can check whether it works like you want?
The first part extends the functionality of node_import_userreference(). The other part makes the module use the same function in case of raw input.
To answer your questions:
4. Yes: user_load(array('mail' => $value))
5. Yes: extend node_import_userreference()
6. Yes: use node_import_userreference() for raw input too (this is a bug in node_import.module)
7. Let me know if this patch would work.
Comment #2
Robrecht Jacques commentedWill be included in node_import-5.x-1.6.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.