Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Attachment search: SQL error [C-Michael83]
#1
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'
Query:
SELECT COUNT(a.aid) AS num_results FROM mybb_attachments a LEFT JOIN mybb_posts p ON (p.pid=a.pid) WHERE 1=1 AND a.mimetype LIKE '%text%'
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
#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
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.
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
#4
Corrected in the SVN - Thanks Michael


Forum Jump:


Users browsing this thread: 1 Guest(s)