Last modified: 2012-01-30 22:15: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 T35966, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33966 - Wrong href in ApiSandbox examples
Wrong href in ApiSandbox examples
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
ApiSandbox (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
https://en.wikipedia.org/wiki/Special...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-26 17:05 UTC by Mormegil
Modified: 2012-01-30 22:15 UTC (History)
3 users (show)

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


Attachments

Description Mormegil 2012-01-26 17:05:06 UTC
ApiSandbox example links, introduced in r109226 (see also bug #32739), use a relative URL pointing just to “api.php?etc.” (exactly as received from the getExamples() method in the API module).

But this does not work if the ApiSandbox special page runs at its canonical location of “.../wiki/Special:ApiSandbox” (examples link to “.../wiki/api.php?etc”, which is wrong), it works only when tested at the raw “.../w/index.php?title=Special:ApiSandbox” path.
Comment 1 Max Semenik 2012-01-26 17:24:49 UTC
Does this break anything? Cause these hrefs are usedonly to be parsed by JS, you should never be able to follow these links.
Comment 2 Mormegil 2012-01-26 17:43:37 UTC
(In reply to comment #1)
> Does this break anything? Cause these hrefs are usedonly to be parsed by JS,
> you should never be able to follow these links.

What do you mean “parsed by JS”? JS uses them to display a hypertext link, and this link (its href attribute) is wrong.

Go to https://en.wikipedia.org/wiki/Special:ApiSandbox, select an action there (e.g. articlefeedback), click the Example button, a link with the text “api.php?action=articlefeedback” and pointing to https://en.wikipedia.org/wiki/api.php?action=articlefeedback appears above. And that destination URL is wrong.
Comment 3 Max Semenik 2012-01-26 18:32:51 UTC
(In reply to comment #2)
> And that destination URL is wrong.

Clicking on such links doesn't bring you to those links' destination.
Comment 4 Mormegil 2012-01-26 19:03:46 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > And that destination URL is wrong.
> 
> Clicking on such links doesn't bring you to those links' destination.

OK, I don’t get it. When I was testing the API using the sandbox, I middle-clicked the example, which opened another tab with “Wikipedia does not recognize the action specified by the URL.” And I saw the href on the anchor does indeed contain the invalid URL. Now, after you pointed that out, I tried left-clicking the link to learn that, indeed, it does nothing (I guess a dummy onclick handler?).

But… What is the point, then? If you want to just display an example URL (with no intention to make it work), then do not wrap it into an <a> tag. If you wrap it, use an href making sense.

Or, what purpose does that anchor serve?
Comment 5 Mark A. Hershberger 2012-01-30 17:46:26 UTC
Took me a bit to understand the request, but I agree, the hyperlinked URLs should point to the /w/api.php URL
Comment 6 Max Semenik 2012-01-30 22:15:41 UTC
r110333.

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


Navigation
Links