Hi
I'm getting a bunch of these errors when importing members:
Error while importing data for property '', datasource record Login = '', Error :The username of a Member must be different from an emptry string Parameter name: loginName Error while importing data for property 'subsSubscriberComments', datasource record Login = '', Error :The username of a Member must be different from an emptry string Parameter name: loginName
(NB: there's a typo "emptry")
Is there a way to bypass this error and import the records anyway (I've just exported them from an old umbraco database so it's valid.)
The typo will be fixed but it can't import empty values on login. Strange that you have those in the old DB. Maybe you can use some event code to use email address when login is empty?
Here's what I tried,
However the breakpoint is never hit, is there an earlier event I should use? it seems the record is already rejected before the event fires?
(Note: a breakpoint earlier in the method does get triggered and shows a valid record which was successfully imported)
public class MemberImportEventHandlers : ApplicationBase
{
public MemberImportEventHandlers()
{
MemberImport.RecordImporting += new MemberImport.RecordImportingEventHandler(MemberImport_RecordImporting);
}
private void MemberImport_RecordImporting(object sender, RecordImportingEventArgs e)
{
var member = sender as Member;
if (member == null)
{
return;
}
if (string.IsNullOrWhiteSpace(e.Items["Login"].ToString()))
{
member.LoginName = "_" + e.Items["Name"]; // <------- breakpoint here.
}
}
}
I have a clue why this is happening. The record isn't imported because the login name is empty so this event is never fired.
Easiest thing to do is to fix the file just update the blanks values with the value you want to use when the login is empty. A bit harder is to create a custom Data Adapter that overides from the CSV Data Adapter and in the GetData method you set the value like you would have done in the event.
Importing blank usernames
Hi
I'm getting a bunch of these errors when importing members:
Error while importing data for property '', datasource record Login = '', Error :The username of a Member must be different from an emptry string Parameter name: loginName
Error while importing data for property 'subsSubscriberComments', datasource record Login = '', Error :The username of a Member must be different from an emptry string Parameter name: loginName
(NB: there's a typo "emptry")
Is there a way to bypass this error and import the records anyway (I've just exported them from an old umbraco database so it's valid.)
The typo will be fixed but it can't import empty values on login. Strange that you have those in the old DB. Maybe you can use some event code to use email address when login is empty?
Best,
Richard
Here's what I tried,
However the breakpoint is never hit, is there an earlier event I should use? it seems the record is already rejected before the event fires?
(Note: a breakpoint earlier in the method does get triggered and shows a valid record which was successfully imported)
Did you already tried moving the breakpoint up?
yep,
I can break into the if clause above and see every 'Login' come through except all the ones where it is blank.
I have a clue why this is happening. The record isn't imported because the login name is empty so this event is never fired.
Easiest thing to do is to fix the file just update the blanks values with the value you want to use when the login is empty. A bit harder is to create a custom Data Adapter that overides from the CSV Data Adapter and in the GetData method you set the value like you would have done in the event.
Best,
Richard
is working on a reply...