Make ApiQueryBase::addTitleInfo optionally able to add the page id
But not by doing an unconditional db query (make the input get it first), as that'd be rather nasty...
Version: 1.20.x
Severity: enhancement
Make ApiQueryBase::addTitleInfo optionally able to add the page id
But not by doing an unconditional db query (make the input get it first), as that'd be rather nasty...
Version: 1.20.x
Severity: enhancement
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | Feature | None | T29810 ID related API requests (tracking) | ||
Open | Feature | None | T30901 Make ApiQueryBase::addTitleInfo optionally able to add the page id |
(In reply to comment #1)
Is there a way to store the page id in the Title object?
Looks like $mArticleID (set by Title::newFromRow)
Bryan.TongMinh wrote:
Ok, so that is easy.
We should first check though if all usages of addTitleInfo() use a Title that was constructed with a row that contains page_id so as to avoid running a new query for every title.
Indeed. May have to change things to use a faux Row object to get the information, but whatever
I was going to do that as part of the cleanup, at worst, in most cases, it'll be just pulling an extra column out of the database if it's not already done
Bryan.TongMinh wrote:
ApiImport is good
ApiPatrol is good
ApiPurge is not good, and is presumably already doing a query for every title because it is doing (new Title)->exists() in a loop.
ApiQuery gets its titles from ApiPageSet; need to check that.
ApiQueryAllimages is not good
ApiQueryAlllinks is not good
ApiQueryBacklinks is not good
... and many others are not good either. So somebody should take some time to fix all of them.
I'm assuming that all those not good ones need similar fixes, right? Would it be possible to do one and point to it here as documentation so I can add this bug to [[mw:Annoying Little Bug]]?
(In reply to comment #5)
ApiQuery gets its titles from ApiPageSet; need to check that.
$pageFlds = array( 'page_namespace' => null, 'page_title' => null, 'page_id' => null, );
Looks good to me
Reverted r106523 in r106862; this is a strange abstraction violation and looks pretty weird to me.