Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-282 now.

Reporting Link causes an SQL Error (fix completed in vcs)

I've "reported" a Topic.

- go to the viewforum.php
- move your mouse over the large exclamation mark
- The ALT Label for this Image is missing ( TOPIC_REPORTED )
- now click on the large exclamation mark:

Code: Select all
SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'r.report_closed = 0 AND p.post_id = r.post_id' at line 3 [1064]

SQL

SELECT COUNT(r.report_id) AS total FROM phpbb_reports r, phpbb_posts p WHERE p.topic_id = 2AND r.report_closed = 0 AND p.post_id = r.post_id

BACKTRACE

FILE: includes/db/mysql4.php
LINE: 117
CALL: dbal_mysql4->sql_error('SELECT COUNT(r.report_id) AS total FROM phpbb_reports r, ph...')

FILE: mcp.php
LINE: 493
CALL: dbal_mysql4->sql_query('SELECT COUNT(r.report_id) AS total FROM phpbb_reports r, ph...')

FILE: includes/mcp/mcp_reports.php
LINE: 218
CALL: mcp_sorting('reports', 0, 't', 'd', Array(5), 'r.report_time DESC', 0, '3', 2)

FILE: includes/functions_module.php
LINE: 336
CALL: mcp_reports->main('reports', 'reports')

FILE: mcp.php
LINE: 183
CALL: p_master->load_active()

Comments / History

Posted by Dr.Death (QA Team) on Mar 29th 2006, 15:09

There is a missing Space in the $where_sql of mcp.php:

SEARCH FOR:

Code: Select all
if ($mode == 'reports')
         {
            $where_sql .= 'AND r.report_closed = 0';
         }
         else
         {
            $where_sql .= 'AND r.report_closed = 1';
         }


REPLACE WITH:

Code: Select all
         if ($mode == 'reports')
         {
            $where_sql .= ' AND r.report_closed = 0 ';
         }
         else
         {
            $where_sql .= ' AND r.report_closed = 1 ';
         }

Linked ticket with changeset: r5771

Action performed by naderman (Development Team Leader) on Apr 8th 2006, 14:30

Ticket details

Related SVN changesets