largersmallernormaltext version of this page

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0015182 [phplist] Message Send Process minor always 01-10-08 21:57 26-03-09 17:41
Reporter CS2 View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version 2.10.5
Summary 0015182: Error 1064 when using stacked attribute selection
Description Using Firefox 3.03, I received consistent Database error 1064 messages, and when showing the IDs of the attributes I selected, there would always be ", " in front of the leading attribute ID.
Additional Information I tracked it down to the first attribute in the "criteria_values" array always being a null value. I modified the code as follows to correct the error in send_core.php:

(Before)
    if (is_array($_POST["criteria_values"])) {
      $values = join(", ",$_POST["criteria_values"]);
    } else {
      $values = $_POST["criteria_values"];
    }

(After)
    if (is_array($_POST["criteria_values"])) {
      # The following code checks for null values in the criteria_attribute array and removes them
      $values = $_POST["criteria_values"];
      foreach ($values as $key=>$value) {
          if (!$value) {
             array_splice($values, $key, 1); // Remove null value from array
        }
      }
      $values = join(", ",$values);
    # $values = join(", ",$_POST["criteria_values"]);
    } else {
      $values = $_POST["criteria_values"];
    }
Tags No tags attached.
Attached Files ? file icon send_core.php [^] (65,929 bytes) 01-10-08 21:57

- Relationships

-  Notes
(0050526)
tishma (reporter)
24-02-09 16:34

Hi,

I can confirm this exists in 2.10.9 as well, and that fix also works.

I believe the real solution should be to find the actual cause of null value at the beginning of values array. Looks like it might have something to do with Javascript.

PHPList 2.10.9
Firefox 3.0.6
PHP 5.2.8
MySQL 5.0.45

Cheers
v.


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker