https://bugzilla.wikimedia.org/show_bug.cgi?id=44571

       Web browser: ---
            Bug ID: 44571
           Summary: addcontributions:; table name prefix leads to invalid
                    SQL statement
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: Unprioritized
         Component: DynamicPageList2
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Using addcontributors leads to the following SQL error:

The DPL extension (version 2.01) produced a SQL statement which lead to a
Database error.
The reason may be an internal error of DPL or an error which you made,
especially when using DPL options like titleregexp.
Query text is:
SELECT DISTINCT `cdam_page`.page_namespace AS
page_namespace,`cdam_page`.page_title AS page_title,`cdam_page`.page_id AS
page_id, SUM( ABS( rc.rc_new_len - rc.rc_old_len ) ) AS contribution,
rc.rc_user_text AS contributor, `cdam_page`.page_title as sortkey FROM
`cdam_recentchanges` AS rc, `cdam_page` INNER JOIN `cdam_categorylinks` AS cl0
ON `cdam_page`.page_id=cl0.cl_from AND (cl0.cl_to='DF') INNER JOIN
`cdam_categorylinks` AS cl1 ON `cdam_page`.page_id=cl1.cl_from AND
(cl1.cl_to='Developer') WHERE 1=1 AND page.page_id=rc.rc_cur_id AND
`cdam_page`.page_is_redirect=0 GROUP BY rc.rc_cur_id ORDER BY page_title ASC
LIMIT 0, 500

Error message is:
Unknown column 'page.page_id' in 'where clause' (localhost)

The error is located in line 2136 of DPLMain.php:

            $sSqlWhere   .= ' AND page.page_id=rc.rc_cur_id';

This line should be changed to:

            $sSqlWhere   .= ' AND '.$sPageTable.'.page_id=rc.rc_cur_id';

The original statement refers directly to the 'page' table, which does not
exist in cases where a database prefix is used.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to