Last modified: 2012-07-05 19:53:22 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 T38438, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36438 - Quotation mark in page title produces wrong JSON export
Quotation mark in page title produces wrong JSON export
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 37418
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-02 13:12 UTC by Finn Årup Nielsen
Modified: 2012-07-05 19:53 UTC (History)
3 users (show)

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


Attachments

Description Finn Årup Nielsen 2012-05-02 13:12:56 UTC
Quotation mark in page title produces wrong JSON export

E.g., a page with the title: 

Limits of self-organization: peer production and "laws of quality"

See an example here: 

http://sandbox.semantic-mediawiki.org/wiki/Limits_of_self-organization:_peer_production_and_%22laws_of_quality%22

With content 

[[title::Limits of self-organization: peer production and "laws of quality"]]
[[author::Paul Duguid]]


{{#ask: [[author::Paul Duguid]]
 |? title 
 |? author
 | format = JSON
}}

the formatted JSON will not escape the quotation mark in the page title: 

	"items": [
		{
			"label": "Limits of self-organization: peer production and "laws of quality"",
			"title": ["Limits of self-organization: peer production and "laws of quality""],
			"author": ["Paul Duguid"]
		}
	]
}

Another example: 

http://wikilit.referata.com/wiki/Special:Ask/-5B-5BCategory:Publications-5D-5D-20-5B-5Bhas-20author::Paul-20Duguid-5D-5D/-3FHas-20author/-3FYear/-3FAbstract/-3FDomain/-3FHas-20topic/limit%3D50/searchlabel%3D/format%3Djson
Comment 1 Jeroen De Dauw 2012-05-02 13:46:53 UTC
Thanks for the report.

I'm utterly unsurprised by this issue, and have written up a proposal to rewrite this result format here: http://semantic-mediawiki.org/wiki/Roadmap#Improve_JSON_format
Comment 2 Finn Årup Nielsen 2012-05-02 15:10:40 UTC
Thanks for the quick reply and the links.

Unless an entire rewrite is done, I guess there is a "FormatJson::encode" missing in line 66. 

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticMediaWiki.git;a=blob;f=includes/queryprinters/SMW_QP_JSONlink.php;hb=HEAD

I suppose there could also be an issue with the properties (lines 48 and 50): Its value and type. I dont know whether SMW accepts a quotation character in the property and its type, though, but wouldn't it be safer to add encoding there too?
Comment 3 MWJames 2012-07-05 19:53:22 UTC
This problem is solved with the new JSON export but please be aware that the JSON structure will change beginning with the deployment of (bug 37418).

[1] http://www.semantic-mediawiki.org/wiki/Help:JSON_format#Structure

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


Navigation
Links