Last modified: 2010-01-16 13:08:20 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 T24061, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22061 - API: add prop=headitems to action=parse
API: add prop=headitems to action=parse
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.16.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Sam Reed (reedy)
http://lists.wikimedia.org/pipermail/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-08 22:00 UTC by P.Copp
Modified: 2010-01-16 13:08 UTC (History)
4 users (show)

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


Attachments
Proposed patch: Add prop=headitems to ApiParse.php (2.68 KB, patch)
2010-01-08 22:08 UTC, P.Copp
Details
Fixup post conflict from whitespace changes (2.65 KB, patch)
2010-01-13 12:14 UTC, Sam Reed (reedy)
Details

Description P.Copp 2010-01-08 22:00:42 UTC
This is from wikitech-l (see URL): Extensions like SyntaxHighlight_GeSHi put generated styles or javascript into the page via ParserOutput->mHeadItems. These items should be made available through the API so gadgets like LivePreview can use them.
Comment 1 P.Copp 2010-01-08 22:08:01 UTC
Created attachment 6942 [details]
Proposed patch: Add prop=headitems to ApiParse.php

Straightforward patch. Also added a getter function for ParserOutput->mHeadItems, which appeared to be missing.
Comment 2 Roan Kattouw 2010-01-09 15:17:41 UTC
(In reply to comment #1)
> Created an attachment (id=6942) [details]
> Proposed patch: Add prop=headitems to ApiParse.php
> 
> Straightforward patch. Also added a getter function for
> ParserOutput->mHeadItems, which appeared to be missing.
> 

Patch looks OK except that it removes the (array) cast in OutputPage.php for no apparent reason.
Comment 3 P.Copp 2010-01-10 14:27:12 UTC
(In reply to comment #2)
> Patch looks OK except that it removes the (array) cast in OutputPage.php for no
> apparent reason.
> 
I'm pretty sure that the cast is not necessary there (since the var is initialised as array() and then only added to), but if you feel uncomfortable with it, of course just skip the change.
Comment 4 Sam Reed (reedy) 2010-01-11 13:26:16 UTC
Assigning to me as per Roan on IRC
Comment 5 P.Copp 2010-01-11 21:52:10 UTC
(In reply to comment #3)
> I'm pretty sure that the cast is not necessary there (since the var is
> initialised as array() and then only added to), but if you feel uncomfortable
> with it, of course just skip the change.
> 
FTR: The cast was added in r21055 (Apr 2007) to deal with old parsercache entries. I think we can safely assume that they're all gone by now :)
Comment 6 Sam Reed (reedy) 2010-01-13 12:14:12 UTC
Created attachment 6952 [details]
Fixup post conflict from whitespace changes
Comment 7 Sam Reed (reedy) 2010-01-13 12:34:47 UTC
I'm gonna end up feeling thick here... But with that patch, what sort of things is it supposed to be outputting? As i've just got my test wiki, with literally nothing on it. 

Did install Geshi..

I was also about to make a really thick comment, but then i realised what i was that issue was. ;) 
Comment 9 Sam Reed (reedy) 2010-01-16 12:57:40 UTC
Cheers - http://mediawiki.pastebin.com/f16990f03

Looks good. Will commit for you in a few
Comment 10 Sam Reed (reedy) 2010-01-16 13:08:20 UTC
r61125

Thanks!

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


Navigation
Links