2008-11-06, 01:06 PM
When trying to moderate (i.e. ignore/delete/approve) unapproved attachments in the ModCP (modcp.php?action=modqueue), I get the following error:
Solution:
Replace the query starting on line 1197 with this:
Quote:SQL Error:
1054 - Unknown column 'p.tid' in 'on clause'
Query:
SELECT a.pid, a.aid FROM attachments a LEFT JOIN threads t ON (t.tid=p.tid) WHERE aid IN (3,4,5,6,8,11)
Solution:
Replace the query starting on line 1197 with this:
$query = $db->query("
SELECT a.pid, a.aid
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$tflist}
");