View Issue Details

IDProjectCategoryView StatusLast Update
0012206phpList 3 applicationSubscriber Importpublic29-04-11 15:59
Status resolvedResolutionfixed 
Product Version2.10.5 
Target Version2.10.13Fixed in Version2.10.14 
Summary0012206: incorrect import of checkboxgroup attributes
DescriptionThis is issue from all versions of phplist, the bug is in import1.php, checked also the newest one from cvs.

The thing is that email import with the same values for attributes does not work for attributes of type checkboxgroup. This type of attribute is an array if fact and phplist tries to deal with it like a linear variable. So du to import phplist inserts such values to the phplist_user_user_attribute table:

select * from phplist_user_user_attribute;

attributeid | userid | value
 1 | 1 | Array
 1 | 2 | Array
 1 | 3 | Array
 1 | 4 | Array

Attribute of id 1 is checkgroupbox. In the result, no values for checkgroupboxes are set during import. Also, the error "Database error 1054 while doing query Unknown column 'Array' in 'where clause'" shows up in several places.

The fix:
 find the following lines in the file admin/import1.php (lines 222-224 in rev 1.14 8/2/2007 from cvs):

while (list($attr,$value) = each($attributes))
 Sql_query(sprintf('replace into %s (attributeid,userid,value)

and replace them with:

while (list($attr,$value) = each($attributes))
 Sql_query(sprintf('replace into %s (attributeid,userid,value)

So the fix is to check if attribute is an array or not, and deal with this.
Works for me :]

TagsNo tags attached.


related to 0003721 closed phpList 3 application phplist 2.10.x 
related to 0004722 assignedmichiel phpList 3 plugins Selection criteria problem with checkbox attribute. 
related to 0005921 closeduser1822 phpList 3 application selecting values in checkbox attribute during import doesn't work 
related to 0015421 resolvedmichiel phpList 3 application Importing CSV with multiple values for Checkboxgroup crashes with SQL Error 


05-11-07 18:27


import1.php (15,000 bytes)


05-11-07 19:49


Thanks will check fix in next release and maybe add it to the code


29-04-11 15:59

manager   ~0051206