Difference between revisions of "Issue:AddContribution missing prefix"

From FollowTheScore
Jump to: navigation, search
(New page: {{Issue |Type = Bug | Change Request <-- please select |Extension = DPL | Wgraph | aiSee | Call <-- please select |Version = 1.5.0 |Description = addcontribution query u...)
 
(Problem)
Line 9: Line 9:
 
== Problem ==
 
== Problem ==
 
addcontribution on a wiki that uses a table prefix results in:
 
addcontribution on a wiki that uses a table prefix results in:
 +
 
The DPL extension (version 1.5.0) produced a SQL statement which lead to a Database error.
 
The DPL extension (version 1.5.0) 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,
 
The reason may be an internal error of DPL or an error which you made,
 
especially when using DPL options like titleregexp.
 
especially when using DPL options like titleregexp.
 +
 
Query text is:
 
Query text is:
SELECT DISTINCT `lw_page`.page_namespace as page_namespace, ... LEFT OUTER JOIN (`lw_categorylinks` AS cl_gc) ON (page_id=cl_gc.cl_from) ... ORDER BY sortkey ASC LIMIT 500
+
 
 +
SELECT DISTINCT `lw_page`.page_namespace as page_namespace, ... LEFT OUTER JOIN (`lw_categorylinks` AS cl_gc) ON
 +
(page_id=cl_gc.cl_from) ... ORDER BY sortkey ASC LIMIT 500
  
 
Error message is:
 
Error message is:
Unknown column 'page.page_id' in 'where clause' (localhost)  
+
Unknown column 'page.page_id' in 'where clause' (localhost)  
  
 
To fix:
 
To fix:
  
 
Change line 2332 in DynamicPageList2.php from:
 
Change line 2332 in DynamicPageList2.php from:
$sSqlWhere  .= ' AND page_id=rc.rc_cur_id';
+
 
 +
$sSqlWhere  .= ' AND page_id=rc.rc_cur_id';
 
to:
 
to:
$sSqlWhere  .= ' AND ' . $sPageTable .'.page_id=rc.rc_cur_id';
 
  
 +
$sSqlWhere  .= ' AND ' . $sPageTable .'.page_id=rc.rc_cur_id';
  
 
== Reply ==
 
== Reply ==

Revision as of 20:34, 24 October 2007

Description: addcontribution query uses raw "page" vs. prefixed page
Extension / Version: DPL   /   1.5.0
Type / Status: Bug   /   open

Problem

addcontribution on a wiki that uses a table prefix results in:

The DPL extension (version 1.5.0) 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 `lw_page`.page_namespace as page_namespace, ... LEFT OUTER JOIN (`lw_categorylinks` AS cl_gc) ON  
(page_id=cl_gc.cl_from) ... ORDER BY sortkey ASC LIMIT 500

Error message is:

Unknown column 'page.page_id' in 'where clause' (localhost) 

To fix:

Change line 2332 in DynamicPageList2.php from:

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

to:

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

Reply