Last modified: 2014-07-14 13:58:13 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 T66657, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64657 - ImportHandle* hooks provide incorrect parameters (WikiImporter instead of XMLReader)
ImportHandle* hooks provide incorrect parameters (WikiImporter instead of XML...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Export/Import (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-30 14:26 UTC by Alexander Lehmann
Modified: 2014-07-14 13:58 UTC (History)
6 users (show)

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


Attachments

Description Alexander Lehmann 2014-04-30 14:26:02 UTC
The hooks ImportHandleLogItemXMLTag[1], ImportHandlePageXMLTag[2], ImportHandleUploadXMLTag[3] and ImportHandleToplevelXMLTag[4] provide a WikiImporter object as parameter instead of a XMLReader object as the documentation asserts. Therefore there is currently no way to access the name of the tag currently being processed or the contents of the tag being processed. 

[1] http://www.mediawiki.org/wiki/Manual:Hooks/ImportHandleLogItemXMLTag
[2] http://www.mediawiki.org/wiki/Manual:Hooks/ImportHandlePageXMLTag
[3] http://www.mediawiki.org/wiki/Manual:Hooks/ImportHandleUploadXMLTag
[4] http://www.mediawiki.org/wiki/Manual:Hooks/ImportHandleToplevelXMLTag
Comment 1 Alexander Lehmann 2014-05-13 12:36:43 UTC
Hey,
I have written a small patch for this bug. You can review it here:
https://gerrit.wikimedia.org/r/#/c/133064/1
Comment 2 Daniel Kinzler 2014-05-14 12:47:32 UTC
Perhaps the better solution would be to fix the documentation and give Import a method for getting the reader (or adding the desired extra info to the info arrays passed to the hooks). It seems useful for the hook functions to have access to things like Import::warn, so they can trigger warnings.
Comment 3 Alexander Lehmann 2014-05-15 12:31:11 UTC
I agree with you. I have now added a getter method for the XMLReader and change the visibility of some functions (e.g. Import::warn) for use in hooks.

https://gerrit.wikimedia.org/r/#/c/133064/

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


Navigation
Links