Foreign Key ignored, always matches on email

Discuss, research, share, find, and solve bugs

Foreign Key ignored, always matches on email

Postby Utz » 7:26am, Sat 07 Mar, 2009

Hi there,

First of all, let me thank everyone involved for all their great work! I just found phplist recently and I've been setting it up and testing it, and everything looks good. I'm impressed with all the attention to detail.

However, I'm having a problem with importing new users. I have read various other threads in this forum on this topic, but I haven't found the answer and I'm hoping someone can help. I'm using phplist version 2.10.9.

I'm trying to import users to lists using the "import emails with different values for attributes" option. My import file is tab-delimited with each line on a newline.

The first time I try to import a record, no problem. However, if I change the email address in the record and then import it again, a new user is created.

My understanding was that having the foreign key column would force phplist to match on this column's value. So the expected behavior is for the original record's email field to be changed, not to get a second record.

When importing, I am checking "Overwrite Existing." Also, the foreign keys are being imported successfully, just not being used for matching.

If anyone has any ideas about this, please let me know. Everything is working except for this part, and I'm stumped.

Thanks again!
Utz
phpList newbie
 
Posts: 3
Joined: 1:57am, Thu 05 Mar, 2009

More info...

Postby Utz » 7:29am, Sat 07 Mar, 2009

I could not post my examples because they contained domain names apparently, so I should say that the column names I'm importing are as follows in the header of my import files (tab-separated, like the default):

foreignkey email username fullname city
Utz
phpList newbie
 
Posts: 3
Joined: 1:57am, Thu 05 Mar, 2009

Postby Utz » 7:49am, Sat 07 Mar, 2009

I was able to fix this, but I can definitely report a bug. The only column name for the foreign key that works without being asked for the field type is "foreignkey". However, in /lists/admin/commonlib/pages/importcsv.php, lines 496 and 497, the foreign key is referred to like this:

$user["systemvalues"]["foreign key"]

When I changed those two references to the following, my problem was solved:

$user["systemvalues"]["foreignkey"]

I continue to use the same column names as I did before.

Looks like this should be fixed in the source and should be clarified in the documentation that the name of the foreign key field is "foreignkey".

Thanks again for a great program! I'll be promoting phplist for sure.
Utz
phpList newbie
 
Posts: 3
Joined: 1:57am, Thu 05 Mar, 2009


Return to Bug Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron