View Issue Details

IDProjectCategoryView StatusLast Update
0015283phplist applicationMessage Send Processpublic09-04-10 18:17
Reporterh2b2 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.10 
Target Version2.10.11Fixed in Version2.10.11 
Summary0015283: v2.10.10: Date criteria does not work
DescriptionUsing Date attributes as criteria does not seem to work anymore.

This issue is reported by Aidan:
==== START QUOTE ====
On the Criteria tab, I try to add a criterion based on the date attribute - I choose the date attribute from the dropdown and enter the date in the format specified, dd-mm-yyyy, and click 'Add Criterion'. But it replaces the date I entered with 0. I get the message 'Adding Submission Date isbefore 0' and it adds a line to the 'Existing Criteria' table which also has '0' in the values column.

Running the Calculate function shows that this criterion has no effect on the number of results returned.
=== END QUOTE ===
Source: http://forums.phplist.com/viewtopic.php?f=17&t=24512#p61910

Issue confirmed on my installation too.
Additional InformationHad a quick look at the code and it seems to me that the use of the cleanCommaList function in send_core.php causes problems when Date type attibutes are used as criteria.

This is a possible fix which seems to work, though I haven't tested it thoroughly. It basically reverts two code lines back to what it was in the previous version:

In lists/admin/send_core.php
1. change line 495
from this: $values = cleanCommaList($values);
to this: // $values = cleanCommaList($values);

2. change line 859
from this: $where_clause .= cleanCommaList($crit_data["values"]) . ") )";
to this: $where_clause .= $crit_data["values"] . ") )";

NOTE: I think the cleanCommaList function was applied to fix this issue: http://mantis.phplist.com/view.php?id=15211
Removing cleanCommaList did not produce any query errors, so the workaround solution suggested by davideg in 15211 wasn't needed.
TagsNo tags attached.

Relationships

related to 0015454 resolvedmichiel database error 1064 when stacking attributes in 2.10.12 

Activities

h2b2

25-08-09 05:51

manager   ~0050714

I wonder whether this issue might be related to other issues involving the
cleanCommaList() function, like for instance http://mantis.phplist.com/view.php?id=15301

h2b2

29-08-09 15:26

manager   ~0050728

A patched send_core.php file with my suggested fix is available on the forum: http://forums.phplist.com/viewtopic.php?f=17&t=24512#p67532

This file includes taydeko's suggested fix for issue 15287 ("FCKeditor doesn't load when opening the 'send a message' page"). See http://mantis.phplist.com/view.php?id=15287

h2b2

16-11-09 09:32

manager   ~0050782

---
The cleanCommaList() function also appears to affect criteria based on radio buttons.

guyshomenet reported this scenario results in the following error message:

"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 'and table1.value in ()' at line 1"

The solution mentioned above appears to fix this issue too.

Related forum thread: http://forums.phplist.com/viewtopic.php?f=17&t=29190

michiel

09-04-10 18:17

manager   ~0050871

yes, the use of the cleancommalist function seems to have caused some issues. Should be ok now.