Last modified: 2014-05-16 20:00:41 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 T67110, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65110 - jsonfm isn't human readable, spews normal json
jsonfm isn't human readable, spews normal json
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CirrusSearch (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-09 22:17 UTC by Chad H.
Modified: 2014-05-16 20:00 UTC (History)
9 users (show)

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


Attachments

Comment 1 Brad Jorsch 2014-05-10 00:37:23 UTC
Looks fine to me when clicking on your link.
Comment 2 Chad H. 2014-05-10 00:39:06 UTC
(In reply to Brad Jorsch from comment #1)
> Looks fine to me when clicking on your link.

Seriously? The first link shows up as normal json without the linebreaks and other prettiness. Brandon saw this first and showed it to me.
Comment 3 Kishan Thobhani (kishanio) 2014-05-10 08:24:39 UTC
(In reply to Chad H. from comment #2)
> (In reply to Brad Jorsch from comment #1)
> > Looks fine to me when clicking on your link.
> 
> Seriously? The first link shows up as normal json without the linebreaks and
> other prettiness. Brandon saw this first and showed it to me.

Yes i feel its okay too. Its just the parser that does the formatting.
Comment 4 Sam Reed (reedy) 2014-05-10 08:25:35 UTC
WFM too
Comment 5 Kunal Mehta (Legoktm) 2014-05-10 08:31:05 UTC
Logged out works for me, logged in it's broken. Disabling the CirrusSearch BF fixes it for me.
Comment 6 Brad Jorsch 2014-05-10 10:25:09 UTC
(In reply to Kunal Mehta (Legoktm) from comment #5)
> Logged out works for me, logged in it's broken. Disabling the CirrusSearch
> BF fixes it for me.

*Now* we're getting somewhere, I can reproduce with Cirrus enabled. Even https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=brand&srlimit=12&format=jsonfm&srbackend=CirrusSearch works.

This tends to indicate something in Cirrus rather than core, but I'll look into it more deeply before saying that for sure.
Comment 7 Brad Jorsch 2014-05-10 10:55:41 UTC
Bug found. It appears that Elastica defines JSON_UNESCAPED_UNICODE and JSON_UNESCAPED_SLASHES in its Elastica/lib/Elastica/Transport/Http.php and Elastica/lib/Elastica/Bulk/Action.php, which is confusing FormatJson into thinking that it can use the new PHP 5.4 features for json_encode instead of having to manually pretty print the JSON.
Comment 8 Brad Jorsch 2014-05-10 11:01:32 UTC
I'd say this is a bug in Elastica for polluting the define namespace, only because if something goes and defines JSON_PRETTY_PRINT too then FormatJson has no real hope of easy feature-detecting.

OTOH, perhaps FormatJson should also be checking for all three constants instead of just the one, Just In Case.

Either way, it has nothing to do with the API.
Comment 9 Chad H. 2014-05-13 16:30:48 UTC
We're dealing with this upstream in Elastica. Once it's fixed there we'll update our library.

See https://github.com/ruflin/Elastica/pull/613
Comment 10 Nik Everett 2014-05-16 19:27:27 UTC
Resolved now that we've updated?
Comment 11 Chad H. 2014-05-16 20:00:41 UTC
(In reply to Nik Everett from comment #10)
> Resolved now that we've updated?

Yep, looks good in beta. It'll go out with the train.

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


Navigation
Links