Hi,
Apologies for posting about this ancient Mediawiki version, but I'm
working in a corporate environment that prevents me from getting a
more up to date version of Mediawiki.
Environment: Mediawiki 1.11.0, PHP 5.0.1, MySQL 5.0.24, DPL 1.8.8
(other DPL versions tried with same results)
Our Wiki was recently moved to a new hosting environment, and during
the move my DPL extension was removed (I was using 1.7.5 at the time).
I have reinstalled DPL several times, but all of them result errors
when using the <DPL> or {{#dpl: constructs.
From what I can see, the call to
$wgContLang->getNamespaces() does not
give any results and thus any use of
|namespace=Foofoo results in an
error message:
Extension:DynamicPageList (DPL), version 1.8.8 : ERROR: Wrong 'Foofoo'
parameter: ! Help: Action= empty string (Main)$3.
Using the DPL constructs without a namespace parameter results in:
-------
The DPL extension (version 1.8.8) 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 cl_head.cl_to, `wasabi_page`.page_namespace as
page_namespace,`wasabi_page`.page_title as
page_title,`wasabi_page`.page_id as page_id,
IFNULL(cl_head.cl_sortkey, REPLACE(CONCAT(
IF(`wasabi_page`.page_namespace=0, , CONCAT(CASE
`wasabi_page`.page_namespace END, ':')), `wasabi_page`.page_title),
'_', ' ')) as sortkey FROM `wasabi_page` LEFT OUTER JOIN
(`wasabi_categorylinks` AS cl_head) ON (page_id=cl_head.cl_from) INNER
JOIN `wasabi_categorylinks` AS cl0 ON
`wasabi_page`.page_id=cl0.cl_from AND (cl0.cl_to='Action') WHERE 1=1
AND NOT (`wasabi_page`.page_title LIKE 'List' OR
`wasabi_page`.page_title LIKE 'List/Archive') AND
`wasabi_page`.page_is_redirect=0 ORDER BY cl_head.cl_to, sortkey ASC
LIMIT 0, 500
Error message is:
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 'END, ':')), `wasabi_page`.page_title), '_', ' ')) as
sortkey FR
(xxxxxxxx.xxx.cell)
-------
Again, I think this is related to the namespace array not being
populated, as the SQL error is caused by the absence of 'WHEN ... THEN
... ELSE' inside the CASE ...END. That part is generated in the code
by looping over the namespace array:
$aNs = $wgContLang->getNamespaces();
ExtDynamicPageList::$allowedNamespaces = array_slice($aNs, 2,
count($aNs), true);
....
// We need the namespaces with strictly positive indices (DPL
allowed namespaces, except the first one: Main).
$aStrictNs = array_slice(ExtDynamicPageList::$allowedNamespaces, 1,
count(ExtDynamicPageList::$allowedNamespaces), true);
// map ns index to name
$sSqlNsIdToText = 'CASE '.$sPageTable.'.page_namespace';
foreach($aStrictNs as $iNs => $sNs)
$sSqlNsIdToText .= ' WHEN ' . intval( $iNs ) . " THEN " .
$dbr->addQuotes( $sNs );
$sSqlNsIdToText .= ' END';
--
Regards,
Jean-Marc
--
. ___
. @@ // \\ "De Chelonian Mobile"
. (_,\/ \_/ \ TortoiseSVN
. \ \_/_\_/> The coolest Interface to (Sub)Version Control
. /_/ \_\
http://tortoisesvn.net