The LogPager is a pager for Special:Log, not a helper for querying logs and not stable to use, LogEventsList::showLogExtract or custom select query (e.g. via SelectQueryBuilder) should be used instead.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T259960 Inject services into API modules and special pages | |||
Resolved | Func | T266480 Extension should not create LogPager, use LogEventsList::showLogExtract or custom select query instead |
Event Timeline
One use case that I can think of that would prevent just using LogEventsList::showLogExtract is when you just want to show a specific log entry ($id of LogPager::__construct).
This can be done by using [ 'conds' => [ 'log_ld' => $id ] ] as the 5th param to showLogExtract().
How can this be fixed for the Approved Revs extension? As you can see in, for example, lines 195 to 215 here, the Approved Revs code is not simply printing out a section of the log - it queries one row of the log, then does its own formatting of the data and prints that out. showLogExtract() doesn't seem to provide the necessary level of flexibility in terms of displaying the output.
Change 931923 had a related patch set uploaded (by Func; author: Func):
[mediawiki/extensions/ApprovedRevs@master] SpecialApprovedRevs: Provide approval logs by ::getQueryInfo()
Change 931923 merged by jenkins-bot:
[mediawiki/extensions/ApprovedRevs@master] SpecialApprovedRevs: Provide approval logs by ::getQueryInfo()
There are two other extensions to work on, I think keep using this task should be fine.
Change 932811 had a related patch set uploaded (by Func; author: Func):
[mediawiki/extensions/GrowthExperiments@master] Use custom select query for logs instead of LogPager
Change 932811 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Use custom select query for logs instead of LogPager
Change 936823 had a related patch set uploaded (by Func; author: Func):
[mediawiki/extensions/ArticleRatings@master] SpecialChangeRating: Use showLogExtract() instead of LogPager
Change 936824 had a related patch set uploaded (by Func; author: Func):
[mediawiki/core@master] LogEventsList: Remove the @stable to call notation on the constructor
Change 936824 merged by jenkins-bot:
[mediawiki/core@master] LogEventsList: Remove the @stable to call notation on the constructor
Change #936823 merged by Jack Phoenix:
[mediawiki/extensions/ArticleRatings@master] SpecialChangeRating: Use showLogExtract() instead of LogPager