Page MenuHomePhabricator

Returning URLs for sitelinks should be optional
Closed, ResolvedPublic

Description

Returning URLs for sitelinks through the calls wbgetitems and wbsetsitelink should be optional. The URLs will be a large part of the content during transfer and it should be possible to turn them off if they will not be used.

They are now returned always.


Version: unspecified
Severity: normal

Details

Reference
bz38569

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:53 AM
bzimport set Reference to bz38569.

picked up because otherwise idle

A normal output should be something like this
http://localhost/repo/api.php?action=wbgetitems&sites=enwiki&titles=Oxygen&props=sitelinks&format=jsonfm
{
"items": {

		"8": {
			"id": 8,
			"sitelinks": {
				"enwiki": {
					"site": "enwiki",
					"title": "Oxygen"
				},
				"afwiki": {
					"site": "afwiki",
					"title": "Suurstof"
				},
				"amwiki": {
					"site": "amwiki",
					"title": "\u12a6\u12ad\u1232\u1305\u1295"
				},

and an output with urls should look like this
http://localhost/repo/api.php?action=wbgetitems&sites=enwiki&titles=Oxygen&props=sitelinks/urls&format=jsonfm

{
"items": {

		"8": {
			"id": 8,
			"sitelinks": {
				"enwiki": {
					"site": "enwiki",
					"title": "Oxygen",
					"url": "http:\/\/en.wikipedia.org\/wiki\/Oxygen"
				},
				"afwiki": {
					"site": "afwiki",
					"title": "Suurstof",
					"url": "http:\/\/af.wikipedia.org\/wiki\/Suurstof"
				},
				"amwiki": {
					"site": "amwiki",
					"title": "\u12a6\u12ad\u1232\u1305\u1295",
					"url": "http:\/\/am.wikipedia.org\/wiki\/%E1%8A%A6%E1%8A%AD%E1%88%B2%E1%8C%85%E1%8A%95"
				},

A minor change of the url syntax for props is in https://gerrit.wikimedia.org/r/#/c/17431/

Note that this is also a fix for an unreported bug, as it was possible to create repeating result sections.

  • This bug has been marked as a duplicate of bug 37306 ***