[Vtigercrm-developers] list view send email bug
lajeesh k
lajeeshk at gmail.com
Wed Oct 14 13:48:01 GMT 2015
this function is making this bug
private function makeGroupSqlReplacements($fieldSqlList, $groupSql) {
echo "<pre>";
print_r($fieldSqlList);//echo $groupSql;
$pos = 0;
$nextOffset = 0;
foreach ($fieldSqlList as $index => $fieldSql) {
$pos = strpos($groupSql, $index.'', $nextOffset);
if($pos !== false) {
$beforeStr = substr($groupSql,0,$pos);echo $beforeStr."<br>";
$afterStr = substr($groupSql, $pos + strlen($index));
$nextOffset = strlen($beforeStr.$fieldSql);
$groupSql = $beforeStr.$fieldSql.$afterStr;
}
}echo $groupSql."<br>";
return $groupSql;
}
Regards,
Lajeesh
On Wed, Oct 14, 2015 at 6:57 PM, lajeesh k <lajeeshk at gmail.com> wrote:
> There is a bug in vtiger send email
> the bug is in query generated using list view query generator
>
> can reproduce this issue like this
>
> create a filter in leads with at least one condition(for ex:created time >
> 2014)
> while we are in this filter search leadstatus = cold or anything from top
> searchbox
> select all listed result (clicking select all is mandatory even if these
> only one result)
> then click send mail, then it will give you a mysql error. enable
> peardatabase loging
> to see the error
>
>
> query generated is
>
> SELECT vtiger_leaddetails.company, vtiger_leaddetails.leadstatus,
> vtiger_leadaddress.city, vtiger_leadaddress.state,
> vtiger_leaddetails.lastname, vtiger_leadaddress.phone,
> vtiger_leaddetails.email, vtiger_leadaddress.mobile, vtiger_leadscf.cf_861,
> vtiger_leadscf.cf_910, vtiger_leaddetails.leadid FROM vtiger_leaddetails
> INNER JOIN vtiger_crmentity ON vtiger_leaddetails.leadid =
> vtiger_crmentity.crmid INNER JOIN vtiger_leadaddress ON
> vtiger_leaddetails.leadid = vtiger_leadaddress.leadaddressid INNER JOIN
> vtiger_leadscf ON vtiger_leaddetails.leadid = vtiger_leadscf.leadid WHERE
> vtiger_crmentity.deleted=0 and vtiger_leaddetails.converted=0 AND ( ((
> vtiger_leaddetails.leadsource = 'Band List 2015') and (
> vtiger_crmentity.createdtime > '2014-12-15 18:29:58') )) ((
> vtiger_leaddetails.leadstatus = 'Cold') ) AND vtiger_leaddetails.leadid > 0
>
>
> and the error is
>
> 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 '((
> vtiger_leaddetails.leadstatus = 'Cold') ) AND vtiger_leaddetails.leadid > 0
> ' at line 1
>
>
> Its4you emailmaker also has error due to this bug
>
> Regards,
> Lajeesh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20151014/381b60f3/attachment.html>
More information about the vtigercrm-developers
mailing list