Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Deleting queued attachments [C-Michael83]
#1
I get this error when trying to delete queued attachments in
modcp.php?action=modqueue

MyBB
MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1054 - Unknown column 'p.tid' in 'on clause'
Query:
    SELECT a.pid, a.aid FROM mybb_attachments a LEFT JOIN mybb_threads t ON (t.tid=p.tid) WHERE aid IN (47,48,51,52,53,54,59,60) 

Please contact the MyBB Group for support.
#2
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
#3
To fix, in modcp.php, find:
$query = $db->query("
			SELECT a.pid, a.aid
			FROM  ".TABLE_PREFIX."attachments a
			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
			WHERE aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$flist}
		");

Replace with:
$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}
		");


Forum Jump:


Users browsing this thread: 1 Guest(s)