View Issue Details

IDProjectCategoryView StatusLast Update
0015465phpList 3 applicationSubscriber Importpublic30-01-12 16:38
Reporternetadmin 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product Version2.10.12 
Target Version2.10.XFixed in Version 
Summary0015465: Database error 1064 when selecting "Import of address data with differring and individual attributes"
DescriptionMain Page => Import => "Import of address data with differring and individual attributes"

Perhaps "Import of address data with differring and individual attributes" is not the exact name of the menu point because I have an installation in german language and tried to translate :-)

If I click on this menu point, http://my.phplist.installation/lists/admin/?page=import2 opens with a red error message box:

Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'yes""' at line 1
Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'yes"" and admin_task.taskid = task.id' at line 1


It´s not possible on the import page to import a file; I can select it but then nothing happens.

Interesting that in phplist 2.10.10 it works but admin/commonlib/pages/importcsv.php seems to having been rewritten in big parts in 2.10.11.
Additional InformationopenSUSE 11.2
apache 2.2.13-2.3.1
PHP 5.3.1
TagsNo tags attached.

Relationships

related to 0011162 closed SQL error on import: syntax error near 'data' since additional data is used 
related to 0015450 resolvedmichiel 'import emails with different values for attributes' does not import test output 
related to 0015568 resolvedsupport database error while importing addresses 
related to 0015566 resolvedsupport Import Broken After Upgrade to 2.10.12 

Activities

h2b2

29-04-10 19:25

manager   ~0050981

Looks like a duplicate of http://mantis.phplist.com/view.php?id=15450
This has been fixed in v2.10.12

netadmin

30-04-10 12:31

reporter   ~0050984

Just made an upgrade to 2.10.12, but I get a mysql error message too. The text is slightly different:

Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"import2&reset=yes""' at line 1
Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"import2&reset=yes"" and admin_task.taskid = task.id' at line 1

netadmin

30-04-10 12:45

reporter   ~0050985

An other interesting thing: the import works with user "admin", but not with other admin accounts. Even if I give them all rights except "SuperAdmin".

h2b2

03-05-10 01:46

manager   ~0050987

Last edited: 03-05-10 01:50

OK, I can confirm this issue, including the same error messages, in the online demo (v2.10.12, logged in as a subadmin, lists/admin/?page=import2). The demo runs with MySQL 5.0.51a
However I cannot replicate this on my own system, which runs MySQL 4.1.22-max-log
Could you mention with mysql version you are using?

netadmin

03-05-10 10:12

reporter   ~0050988

mysql Ver 14.14 Distrib 5.1.36, for suse-linux-gnu (x86_64) using readline 6.0

ttinits

14-05-10 11:00

reporter   ~0051009

Hello,

I had the same issue with my phplist program. When I started to dig in I found a small mistake:
If you see file /admin/commonlib/pages/importcsv.php, there are errors on line 119, 438 and 914.

For example line 119
  print '<p class="button">' . PageLink2($_GET["page"] . '&reset=yes"', $GLOBALS['I18N']->get('Reset Import session')) . '

';

There should be '&reset=yes' <- i guess there is one " too much.
Same mistake is on other two lines but with '&confirm=yes"'

This fixed it for me.
Hope it's helpful to You too.

netadmin

19-05-10 14:03

reporter   ~0051015

Hi ttinits,

yes, this was quite helpful!! Fixed it for me too :-)

Thanks a lot!!

jer1024

08-07-10 18:01

reporter   ~0051055

I tried ttinits fix.
Still receiving same error.

jer1024

08-07-10 18:21

reporter   ~0051056

BTW MySQL 5.0.45

ttinits

09-07-10 06:21

reporter   ~0051057

What is your PhpList version? Mine was v2.10.12. And since I have made lots of code changes I have no wish to upgrade soon :-P

jer1024

09-07-10 20:45

reporter   ~0051059

Nevermind, it was my error. I jumped the gun (noticing that in the code '&reset=yes' was '&reset=yes') After changing that nothing was fixed so I ran a search thru the folder for '&' and noticed that the HTML chars were converted later... OK that was supposed to be that way... oops
Anyways when I looked at the line again I saw the dangling "
Looked back at the post and promptly smacked myself upside the forehead.

It works now, Thanks :)

h2b2

02-12-10 12:51

manager   ~0051138

Hannes Gruber notes that "importcsv.php: produced an Error in the MySQL Query if the user did not have all super User priviledges" and suggests a more or less similar fix in attached file: fix.diff
ref: pipermail/phplist-developers/2010-October/000180.html

h2b2

02-12-10 12:52

manager  

fix.dif (3,563 bytes)

solmar

27-01-11 14:47

reporter   ~0051156

Just to confirm that this problem is present in 2.11 too, and ttinits fix #0051009 apparently solves it.
Line numbers cited by ttinits do not correspond in 2.11, but removing the misplaced quote from

confirm=yes"'

seems to be enough.
Subsequent CSV import went fine.

michiel

29-04-11 17:42

manager   ~0051213

I think that was already fixed.