Last modified: 2009-02-19 21:55:57 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 T19563, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17563 - Backlinks output format changed
Backlinks output format changed
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.15.x
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php?act...
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-19 00:56 UTC by Alex Z.
Modified: 2009-02-19 21:55 UTC (History)
4 users (show)

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


Attachments
Patch against r47478 to fix the issue (2.99 KB, patch)
2009-02-19 03:02 UTC, Brad Jorsch
Details
The requested patch with b0rken indentation (1.42 KB, patch)
2009-02-19 03:05 UTC, Brad Jorsch
Details
The requested patch to fix the whitespace from the previous patch (2.53 KB, patch)
2009-02-19 03:08 UTC, Brad Jorsch
Details

Description Alex Z. 2009-02-19 00:56:09 UTC
After the last scap on Wikimedia, backlinks/embeddedin queries have started using a different JSON output format from the other list= queries, from an array to an object. The generator queries are also buggy, returning an empty array before the object with the pages - http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&generator=embeddedin&geititle=Template:Fact
Comment 1 Brad Jorsch 2009-02-19 03:02:15 UTC
Created attachment 5830 [details]
Patch against r47478 to fix the issue

This looks like a large patch, but it's mostly indentation. The actual changes are:
* The whole block of code calling addValue is only called if $resultPageSet is null (i.e. non-generator mode). This results in all the indenting.
* $this->resultArr is passed through array_values in the "try to add them all at once" case, so the output is as an array instead of an object.
* In the "add elements one by one" case, similarly don't specify a key.
* Slight rearrangement at the bottom of the function to eliminate a redundant conditional.
Comment 2 Edward Z. Yang 2009-02-19 03:03:17 UTC
It's considered good form to separate whitespace/code formatting and actual code changes when constructing patches.
Comment 3 Brad Jorsch 2009-02-19 03:05:57 UTC
Created attachment 5831 [details]
The requested patch with b0rken indentation

Well, if you really want a patch that has b0rken indentation just so a followup can fix it...
Comment 4 Brad Jorsch 2009-02-19 03:08:45 UTC
Created attachment 5832 [details]
The requested patch to fix the whitespace from the previous patch

And here's the followup to fix the b0rken indentation.
Comment 5 Roan Kattouw 2009-02-19 21:55:57 UTC
(In reply to comment #1)
> Created an attachment (id=5830) [details]
> Patch against r47478 to fix the issue

Applied verbatim in r47514.

(In reply to comment #2)
> It's considered good form to separate whitespace/code formatting and actual
> code changes when constructing patches.
> 
If the whitespace changes are completely unrelated, that's definitely true. This case, where an if() is added and the statements inside it are indented and changed is kind of a corner case. I decided to commit the whole thing in one go, but having a patch without whitespace changes certainly made review clearer.

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


Navigation
Links