https://bugzilla.wikimedia.org/show_bug.cgi?id=24774

           Summary: rvexpandtemplates=true does not expand templates in
                    ref tags
           Product: MediaWiki
           Version: 1.17-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: API
        AssignedTo: roan.katt...@gmail.com
        ReportedBy: gabumo...@hotmail.com
                CC: bryan.tongm...@gmail.com, s...@reedyboy.net,
                    vasi...@gmail.com, soxre...@gmail.com


Any call to the API with action=query, prop=revisions, rvprop=content, and
rvexpandtemplates=true does not have expanded templates in the content when
that template is contained within <ref></ref> tags.

To reproduce, just make any such call to the API.  For example:

http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Train&rvlimit=1&rvprop=content&redirects=true&rvexpandtemplates=true

Note that the templates within <ref> tags are not expanded:

<ref>{{cite web | title = Train (noun) | work = (definition - Compact OED) |
publisher = Oxford University Press | url =
http://www.askoxford.com/concise_oed/train?view=uk | accessdate =
2008-03-18}}</ref>

It should instead expand the template like this:

<ref><span class="citation web"
>[http://www.askoxford.com/concise_oed/train?view=uk "Train (noun)"]. ''<nowiki 
>/>(definition - Compact OED)<nowiki />''. Oxford University Press<span 
>class="printonly">. 
>http://www.askoxford.com/concise_oed/train?view=uk</span><span 
>class="reference-accessdate">. Retrieved 2008-03-18</span>.</span><span
    class="Z3988"
   
title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.btitle=Train+%28noun%29&rft.atitle=%28definition+-+Compact+OED%29&rft.pub=Oxford+University+Press&rft_id=http%3A%2F%2Fwww.askoxford.com%2Fconcise_oed%2Ftrain%3Fview%3Duk&rfr_id=info:sid/en.wikipedia.org:API"><span
style="display: none;">&nbsp;</span></span></ref>

This has no good workaround; the best I can find is to grab all of the
unexpanded templates and feed them into another call to the API with
action=expandtemplates and text=(the templates), which is not very good not
only because it's extra hassle, but also because it requires twice as many
calls to the API, which inevitably slows things down considerably.

Build 2010-08-12 on Windows 7 Enterprise (though it being the result of an API
call, I would imagine it reproduces anywhere)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to