Issue Bug Closed

#17528BEenableFields returns only ' AND ' in some cases

Franz Holzinger 08/13/07, 16:55 updated 07/02/10, 11:19

Description

If you call BEenableFields and nothing fits for the IF condition inside, then ‘ AND ‘ is returned. This is very bad, because it leads to a SQL error if this strange return value is not caught and not used to build a SQL query.
So this behaviour complicates the thing very much.

Solution:

$outQ = ($inv ? ($invQuery != ‘’ ? ‘(‘.implode(’ OR ‘,$invQuery).’)’ : ‘’) : ($query != ‘’ ? implode(’ AND ‘,$query) : ‘’));
$outQ = ($outQ != ‘’ ? ‘ AND ‘.$outQ : ‘’);
(issue imported from #M6141)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.