Last modified: 2011-12-20 21:21:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30901, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28901 - Make ApiQueryBase::addTitleInfo optionally able to add the page id
Make ApiQueryBase::addTitleInfo optionally able to add the page id
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.20.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks: 27810
  Show dependency treegraph
 
Reported: 2011-05-09 20:40 UTC by Sam Reed (reedy)
Modified: 2011-12-20 21:21 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2011-05-09 20:40:19 UTC
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...
Comment 1 Bryan Tong Minh 2011-05-10 09:07:32 UTC
Is there a way to store the page id in the Title object?
Comment 2 db [inactive,noenotif] 2011-05-13 14:30:28 UTC
(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)
Comment 3 Bryan Tong Minh 2011-05-14 08:56:27 UTC
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.
Comment 4 Sam Reed (reedy) 2011-05-14 09:06:45 UTC
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
Comment 5 Bryan Tong Minh 2011-05-14 09:18:22 UTC
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.
Comment 6 Mark A. Hershberger 2011-05-20 16:03:44 UTC
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]]?
Comment 7 Mark A. Hershberger 2011-05-20 16:29:50 UTC
Ugh, that is a page on Mediawiki.org
Comment 8 Sam Reed (reedy) 2011-05-20 17:15:38 UTC
(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
Comment 9 db [inactive,noenotif] 2011-12-17 18:27:34 UTC
r105831
Comment 10 Brion Vibber 2011-12-20 21:21:48 UTC
Reverted r106523 in r106862; this is a strange abstraction violation and looks pretty weird to me.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links