Last modified: 2011-04-30 01:20:47 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 T27232, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25232 - API custom class inherited from ApiQueryBase does not call getCustomPrinter() method
API custom class inherited from ApiQueryBase does not call getCustomPrinter()...
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.15.x
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-21 15:18 UTC by Dmitriy Sintsov
Modified: 2011-04-30 01:20 UTC (History)
4 users (show)

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


Attachments

Description Dmitriy Sintsov 2010-09-21 15:18:42 UTC
I've defined getCustomPrinter() in my extension's class derived from ApiQueryBase. However, it's simply not being called, even though, both ApiBase class and ApiQuery define this method and ApiQueryBase extends ApiBase.

Because of that, I am forced to use &export and &exportnowrap parameters, which are unnecessary (extra bloat) in my case.

There must be something flawed in this logic, I think so.
Comment 1 Roan Kattouw 2010-09-21 15:22:09 UTC
Query submodules can be called in conjunction with other query submodules, like so:

api.php?action=query&list=allpages&meta=siteinfo|userinfo&prop=info|revisions

In this case, if your module would switch to a custom printer, the others would quite likely freak out. Architecturally, the ApiQuery class is the main module being called and it is ApiQuery that determines the custom printer etc.; it only calls ApiQuery* classes to populate parts of its result, but those classes aren't fully-fledged modules.
Comment 2 Dmitriy Sintsov 2010-09-21 15:48:29 UTC
Thank you. I should try inherit ApiBase instead. Didn't think about the possible conjunction of ApiQueryBase instances.
Comment 3 Dmitriy Sintsov 2010-09-21 17:08:44 UTC
However, now setContinueEnumParameter() became unavailable, too. Shall I re-define it in my own class which extends ApiBase now, or there is a better approach?
Comment 4 Dmitriy Sintsov 2010-09-21 17:23:49 UTC
Also ApiQueryBase has a lots of nice SQL expression building methods, they're all not unavailable when deriving from ApiBase :-(

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


Navigation
Links