View Issue Details

IDProjectCategoryView StatusLast Update
0015454phplist applicationAll Otherpublic19-05-15 16:23
Reportercmacsound 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.12 
Target Version2.10.13Fixed in Version2.10.14 
Summary0015454: database error 1064 when stacking attributes in 2.10.12
Descriptionresurfaced comma syntax error in version 2.10.12 when stacking attributes. previous clean-comma patches not helping. Using Firefox 3.6.3. mySQL 5.0.90-community-log.

"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 '2)' at line 3"

EXAMPLE:
"
Existing criteria
    
City/Region is , 2 remove
 
CALCULATE
"
    
TagsNo tags attached.

Relationships

related to 0015283 resolveduser4540 phplist application v2.10.10: Date criteria does not work 
related to 0009983 resolvedmichiel phplist application parentheses missing in sql statements in stacked criteria code, send_core.php 
related to 0015182 resolvedmichiel phplist application Error 1064 when using stacked attribute selection 
related to 0015301 resolvedmichiel phplist application function UserAttributeValue will end up with no value in $val_ids[0] causing sql command to fail 
related to 0015211 resolvedmichiel phplist application STACKED_ATTRIBUTE_SELECTION "," error on values 
related to 0015565 new phpList plugins Incorrect record selection in Stacked Criteria 

Activities

cmacsound

24-04-10 07:25

reporter   ~0050966

...also appears that attribute value criteria is not saving properly when stacked attribute is disabled...

h2b2

24-04-10 13:41

manager   ~0050967

I can confirm this issue on my 2.10.12 install. While criteria selection seems to work fine with 'date' attributes, when using the 'select' type attribute generates a database error 1064.

Example:
Existing criteria operator values
Date of birth is before 10-04-2010, 0
Preferred color is , 1

System details:
    * phplist version: 2.10.12
    * PHP version: 5.2.3
    * Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    * Webserver: Apache/1.3.37 (Unix) PHP/5.2.3 mod_ssl/2.8.28 OpenSSL/0.9.8a mod_perl/1.29 FrontPage/5.0.2.2510
    * Mysql Info: 4.1.12-standard-log
    * PHP Modules: libxml, xsl, xmlwriter, dom, xmlreader, xml, tokenizer, session, pcre, SimpleXML, SPL, PDO, sockets, SQLite, standard, Reflection, posix, pdo_sqlite, pdo_mysql, mysql, mhash, mcrypt, mbstring, json, imap, iconv, hash, gettext, gd, ftp, filter, exif, date, curl, ctype, calendar, bcmath, zlib, openssl, apache, Zend Optimizer

h2b2

27-04-10 16:03

manager   ~0050972

Same issue when using 'radio' type attributes. though it seems to work fine with 'date' type and 'checkboxgroup' type attributes.

Can also be reproduced on the online demo (currently running v2.10.11).

h2b2

01-06-10 03:08

manager   ~0051028

jfquestiaux suggests this (temporary) fix:

==== Start Quote ====
Since I upgraded to version 2.10.12, I have a bug (confirmed in Mantis) when it comes to select criteria to choose users to send to.

There is a syntax error beacause of a "," added in front of the criteria.

The culprit is the "cleanCommaList" function in the admin/connect.php file.

To correct that, uncomment the "old" cleanCommaList function (on line 1132) and comment out the "new one" (lines 1136 - 1145), or fix the code (and share the solution) if your skills allow to.
===== End Quote =====
ref: http://forums.phplist.com/viewtopic.php?p=75395#p75395

Reverting to the old cleanCommaList function appears to fix this on my system too.

For those needing more detailed instructions: In lists/admin/connect.php, starting from line 1132,
change this:

#function cleanCommaList($list) {
# return join(',',cleanArray(split(',',$list)));
#}

function cleanCommaList($sList) {
  if (!strpos($sList,',')) return $sList;
  $aList = explode(',',$sList);
  foreach ($aList as $key=>$value) {
    if(!$value) {
       array_splice($aList, $key, 1); //Remove null value from array
    }
  }
  return join(',',$aList);
}


To this:

function cleanCommaList($list) {
  return join(',',cleanArray(split(',',$list)));
}

#function cleanCommaList($sList) {
# if (!strpos($sList,',')) return $sList;
# $aList = explode(',',$sList);
# foreach ($aList as $key=>$value) {
# if(!$value) {
# array_splice($aList, $key, 1); //Remove null value from array
# }
# }
# return join(',',$aList);
#}

michiel

28-04-11 15:47

manager   ~0051182

http://phplist.svn.sourceforge.net/phplist/?rev=2649&view=rev