Extension talk:DynamicPageListEngine


PHP warnings

Im getting PHP warnings just because of some whitespaces at the end of DynamicPageListEngine.php. Just remove these whitespaces or the endtag to solve the problem. Louperivois (talk) 20:32, 23 May 2017 (UTC)

How to get this extension to work?

I downloaded DataTable2 from Sourceforge, installed it with
require_once "$IP/extensions/DataTable2/DataTable2.php";
and... nothing. The LUA console tells me:
Lua error in console ... attempt to index field 'dpl' (a nil value).
This is what I had typed in:
=mw.ext.dpl.getPagenames{ namespace = 14, text = 'Traversal' }
Is there anything else I need to do? Is DataTable2 even the same extension as DynamicPageListEngine? Zewas (talk) 18:06, 14 July 2017 (UTC)
I'm afraid the sourceforge storage is confusing. For some years I had absolutely no time to reorganize this even though I continued developing the extension. Today I have requested the creation of a gerrit repo, so a download via the modern MediaWiki facilities will hopefully be available soon. RV1971 (talk) 21:09, 25 March 2018 (UTC)
Well, I had to disable the extension altogether because it created mysterious database errors on non-module pages... Zewas (talk) 12:30, 15 July 2017 (UTC)

DynamicPageListEngine.php is absent

In version for MW1.32 the DynamicPageListEngine.php is absent.

Install recommendations get wiki-engine to fall.

If take DynamicPageListEngine.php from some previous version (I had 0.2), the engine will work, but there is uncertainty is ext works correctly.. Sphynkx (talk) 02:12, 1 February 2019 (UTC)

I'm afraid the installation instructions were outdated. Thanks for spotting this, I have just fixed them. RV1971 (talk) 17:51, 3 February 2019 (UTC)

Need more information on usage

The Special:Version page shows that it has been installed, and I have included it in LocalSettings.php. But when I try to use the tag <DPL> or <DPLE> or any sort of combination of those names written out with the parameters enabled as default, it doesn't actually turn into a list and only has the tags written out like plain text.

I've installed this on a fresh mediawiki install and this is my first time using it, so any obvious pointers would help. 184.148.74.132 (talk) 15:42, 10 May 2019 (UTC)

DPLE does not add syntax tags. It is a backend that can be accessed via Lua only, you need to write your own modules to use it. RV1971 (talk) 20:37, 12 May 2019 (UTC)

Fix for PHP 8.1 (TypeError)

In PHP 8.1, there is a TypeError when calling mw.ext.dpl.getPages on account of lines 91 and 104 in /includes/DpleFeatureNamespace.php - the use of PHP's `count` causes an exception if namespace is not provided (or if notNamespaces is not provided) because it attempts to call count on null. This can easily be fixed with PHP 7.0's null-coalescing operator ('??'), or alternatively to support older versions you can just use a ternary to check if the array is null and replace with an empty array before calling count.

(Another option might be to wrap the switch cases in an if statement.)

I would submit a patch for this myself but unfortunately I do not have experience with MediaWiki's/Gerrit submission process and don't immediately have the time to work out how to do it. GSSNYC (talk) 16:01, 8 September 2022 (UTC)

The same applies to /includes/DpleFeatureExtra.php, line 85. GSSNYC (talk) 16:25, 8 September 2022 (UTC)
...and /includes/DpleFeatureExtrax.php, line 83. GSSNYC (talk) 16:33, 8 September 2022 (UTC)
Thanks for spotting this. Fix has been uploaded to Gerrit for review. RV1971 (talk) 16:54, 11 September 2022 (UTC)

ResultWrapper vs MysqliResultWrapper

I was trying to use the lua functions, and, no matter what parameters I tried, I got the same error message:

Exception caught: DpleFeatureResults::toFullpagenames(): Argument #1 ($result) must be of type ResultWrapper, Wikimedia\Rdbms\MysqliResultWrapper given, called in /var/www/mediawiki/extensions/DynamicPageListEngine/includes/DynamicPageListEngine.php on line 125

(I got variations of this error for `getFullpagenames`, `getPagenames`, and `getPages`.)

I was able to fix the error (I think!) by changing the argument type to MysqliResultWrapper in the /include/DpleFeatureResults.php file (replaced all in the file, and had to import using `use Wikimedia\Rdbms\MysqliResultWrapper`), but I didn't want to push too far since I don't know what the downstream effects of that kind of change would be.  By making the change, I did not get the error. The results of my lua script were still not correct, but that's probably an issue with my lua, not with DPLE ;)

MediaWiki version 1.42

DPLE version 1.1.0-rc1 (1545ff3) 02:09, 2 November 2024

sample lua:

function p.getPages(titletext)

   local pages = mw.ext.dpl.getFullpagenames{
       namespace = 0,
       titleprefix = titletext
   }

end Germy Parker (talk) 20:24, 9 November 2024 (UTC)

Just an update/correction: using the MysqliResultWrapper replacement, I got my full functionality using the following query:
local queryParams = {
titleprefix = inputPrefix,
subpages = "only"
}
local results = mw.ext.dpl.getFullpagenames(queryParams)
This query produces expected results, but without replacing ResultWrapper with MysqliResultWrapper, it produces the error. Germy Parker (talk) 22:38, 9 November 2024 (UTC)
I'm afraid I'm not up to date right now, my own installation is MW 1.40. Up to that version, ResultWrapper.php contains a class_alias statement that defines a global alias ResultWrapper. This has been removed in 1.41 (which is clearly a progress in terms of code structure), so now my extension code needs a use Wikimedia\Rdbms\ResultWrapper;. Similar updates might be necessary in other files. I apologize that probably I'll not have time to do this in the next days. RV1971 (talk) 20:38, 10 November 2024 (UTC)
I have submitted a fix in Adapt to PHP 8 and MW 1.41. Now I'm waiting for someone to review it. RV1971 (talk) 15:44, 2 December 2024 (UTC)

Table name component contains unexpected quote or dot character

The OpenStreetMap Wiki is considering installing this extension, but we're getting tripped up by a fatal error that seems to be related to the extension's query code. Not sure if it's related to #ResultWrapper vs MysqliResultWrapper, but we're on PHP 8 as well. Minh Nguyễn 💬 21:14, 1 May 2025 (UTC)