Closed (fixed)
Project:
Simplenews
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2011 at 13:07 UTC
Updated:
1 Jan 2012 at 17:40 UTC
Hi,
In includes/simplenews.admin.inc, we have this code:
// All conditions are combined with AND
$where = empty($where) ? '' : ' AND '. implode(' AND ', $where);
It seems the value for non-empty $where in the ternary wants to be prefixed with ' WHERE ',
not the ' AND '.
It seems to work fine at the moment because it is appended to the end
of an INNER JOIN condition:
$query = '
SELECT DISTINCT ss.snid, ss.*, u.name
FROM {simplenews_subscriptions} ss
LEFT JOIN {users} u
ON ss.uid = u.uid
INNER JOIN {simplenews_snid_tid} s
ON ss.snid = s.snid
' . $filter['where'];Attached is a very simple patch for it.
Cheers,
Paul
| Comment | File | Size | Author |
|---|---|---|---|
| prefixed_where_clause.patch | 518 bytes | leebroozlee |
Comments
Comment #1
leebroozlee commentedComment #2
simon georges commentedHum... It seems you're right! I'll fix it next time I'm on the code. Thanks for the report!
Comment #3
berdirYep, looks good.
Comment #4
simon georges commentedCommitted.
The code has been transformed to DBTNG in 7.x, so no need to port it.