Current time: 03-22-2010, 02:43 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Attachment search: SQL error [C-Michael83]
10-20-2008, 12:05 PM
Post: #1
[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'
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
-------------
German MyBB-Site
MyBBoard.de
Get the german languagepack here
Visit this user's website Find all posts by this user
10-21-2008, 01:33 AM
Post: #2
[F] Attachment search: SQL error
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

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
10-30-2008, 07:31 PM (This post was last modified: 10-30-2008 07:47 PM by Michael S..)
Post: #3
RE: [F] Attachment search: SQL error
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:
PHP Code:
$form_container->output_row($lang->type_contains""$form->generate_text_box('mimetype'$mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype'); 
Replace with:
PHP Code:
$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
-------------
German MyBB-Site
MyBBoard.de
Get the german languagepack here
Visit this user's website Find all posts by this user
10-30-2008, 08:04 PM
Post: #4
RE: [F] Attachment search: SQL error
Corrected in the SVN - Thanks Michael

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user


Forum Jump: