phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015454phplist applicationAll Otherpublic24-04-10 08:1319-05-15 17:23
Reportercmacsound 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
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.
Attached Files

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

-  Notes
(0050966)
cmacsound (reporter)
24-04-10 08:25

...also appears that attribute value criteria is not saving properly when stacked attribute is disabled...
(0050967)
h2b2 (manager)
24-04-10 14:41

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
(0050972)
h2b2 (manager)
27-04-10 17:03

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).
(0051028)
h2b2 (manager)
01-06-10 04:08

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);
#}
(0051182)
michiel (manager)
28-04-11 16:47

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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker