Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Attachment search: SQL error [C-Michael83]
If you search for an attachment in the Admin-CP you get an SQL error:
Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'a.mimetype' in 'where clause'
SELECT COUNT(a.aid) AS num_results FROM mybb_attachments a LEFT JOIN mybb_posts p ON ( WHERE 1=1 AND a.mimetype LIKE '%text%'
[Image: donation_drive_sig.png]
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
Changeset #4249

This fix is incomplete. You can enter whatever you want into the field "File type contains" of the search form. You'll always get all attachments shown in the results list.

Fix: Find in the file admin/modules/forum/attachments.php:
$form_container->output_row($lang->type_contains, "", $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype');
Replace with:
$form_container->output_row($lang->type_contains, "", $form->generate_text_box('filetype', $mybb->input['filetype'], array('id' => 'filetype')), 'filetype');

In line 780 in the $pagination_vars array mimetype has to be changed to filetype, too.
[Image: donation_drive_sig.png]
Corrected in the SVN - Thanks Michael

Forum Jump:

Users browsing this thread: 1 Guest(s)