Last modified: 2013-07-17 15:51:56 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 T53508, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51508 - POTD Title returned by expandtemplates is not correct.
POTD Title returned by expandtemplates is not correct.
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-17 06:36 UTC by Harin Sutaria
Modified: 2013-07-17 15:51 UTC (History)
4 users (show)

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


Attachments

Description Harin Sutaria 2013-07-17 06:36:41 UTC
I am using the Wiki API for accessing the entire Wiki.

When I am calling the following API;
http://en.wikipedia.org/w/api.php?action=expandtemplates&format=json&text={{POTD/{{#time:Y-m-d}}|title}}
I get the following output;
{
    "expandtemplates": {
        "*": "''[[A Wheat Field with Cypresses]]''"
    }
}
which I use in the next API as follows to get the actual image for this title. 
http://en.wikipedia.org/w/api.php?action=query&prop=pageimages&piprop=thumbnail|name&pithumbsize=240&format=json&redirects=&titles=A%20Wheat%20Field%20with%20Cypresses

But it seems the title contains an additional "A" because of which it gives me missing element.
{
    "query": {
        "pages": {
            "-1": {
                "ns": 0,
                "title": "A Wheat Field with Cypresses",
                "missing": ""
            }
        }
    }
}
But if I remove "A" from the title it gives me proper details as follows;
{
    "query": {
        "pages": {
            "27773473": {
                "pageid": 27773473,
                "ns": 0,
                "title": "Wheat Field with Cypresses",
                "thumbnail": {
                    "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Vincent_Willem_van_Gogh_049.jpg/240px-Vincent_Willem_van_Gogh_049.jpg",
                    "width": 240,
                    "height": 191
                },
                "pageimage": "Vincent_Willem_van_Gogh_049.jpg"
            }
        }
    }
}

This is breaking my Web App which I am developing as the title returned by API is incorrect. Please let me know if this is an actual bug or the title entered is incorrect or I am making a mistake somewhere.

Thanks and Regards,
Harin
Comment 1 Brad Jorsch 2013-07-17 15:51:56 UTC
The "title" field in https://en.wikipedia.org/wiki/Template:POTD/2013-07-17 is not correct. This has nothing to do with the API or MediaWiki.

Also, BTW, if you want the image why are you not fetching https://en.wikipedia.org/w/api.php?action=expandtemplates&format=json&text={{POTD/{{%23time:Y-m-d}}|image}} ?

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


Navigation
Links