Last modified: 2014-04-07 17:02:51 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 T65613, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63613 - links from template not displayed
links from template not displayed
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-07 12:26 UTC by richlv
Modified: 2014-04-07 17:02 UTC (History)
3 users (show)

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


Attachments

Description richlv 2014-04-07 12:26:44 UTC
if a link is coming from a template, it does not show up when editing the page in visual editor.

testcase :
https://www.zabbix.org/wiki/Docs/visual_editor_test

in the editing mode link text is not displayed.
(if creating an account to test, real name is mandatory)

used template : https://www.zabbix.org/wiki/Template:ZBXNEXT

node.js log contains :


starting parsing of localhost:Docs/visual_editor_test
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://www.zabbix.org/mw/api.php">here</a>.</p>
<hr>
<address>Apache/2.2.22 (Linux/SUSE) Server at localhost Port 80</address>
</body></html>

error in localhost:Docs/visual_editor_test: Template Expansion failure for "{{ZBX|1}}": 301
Stack:
  PreprocessorRequest._handleJSON (/home/root-rich/files/parsoid/lib/mediawiki.ApiRequest.js:415:12)
  PreprocessorRequest.ApiRequest._handleBody (/home/root-rich/files/parsoid/lib/mediawiki.ApiRequest.js:189:8)
  PreprocessorRequest.ApiRequest._requestCB (/home/root-rich/files/parsoid/lib/mediawiki.ApiRequest.js:166:8)
  Request.self.callback (/home/root-rich/files/parsoid/node_modules/request/request.js:129:22)
  Request.EventEmitter.emit (events.js:98:17)
  Request.<anonymous> (/home/root-rich/files/parsoid/node_modules/request/request.js:873:14)
  Request.EventEmitter.emit (events.js:117:20)
  IncomingMessage.<anonymous> (/home/root-rich/files/parsoid/node_modules/request/request.js:824:12)
completed parsing of localhost:Docs/visual_editor_test in 3316 ms
Comment 1 richlv 2014-04-07 12:28:31 UTC
this seems to be parsoid from git 45a32f444a7eed48e691b31931091a02185e06b6
Comment 2 ssastry 2014-04-07 15:02:37 UTC
We should be able to reproduce this on a local wiki with the contents of that template.

* Template source is: https://www.zabbix.org/mw/index.php5?title=Template:ZBX&action=edit ... 
* Test snippet: {{ZBX|1}}

We know of some regressions from that commit. It is is not yet deployed onto production, but yes, master has failures. https://gerrit.wikimedia.org/r/#/c/123908/ may fix it (not yet merged).
Comment 3 Arlo Breault 2014-04-07 15:56:57 UTC
The problem here is that interwiki link is redirecting from http to https. ex.

parsoidConfig.setInterwiki('zap', 'http://www.zabbix.org/mw/api.php');

should be

parsoidConfig.setInterwiki('zap', 'https://www.zabbix.org/mw/api.php');

did you recently switch to https only?

Template expansion is trying to query the api but getting a 301 redirect in response ... which produces the error instead of following it.
Comment 4 richlv 2014-04-07 16:12:36 UTC
if the question about https was for me, there is a redirect for http -> https, but visual editor was installed recently and this problem was there from the very beginning.

given that i'm accessing the page over https, shouldn't it work automatically ?

the only non-https connection i can see is the wgVisualEditorParsoidURL, which goes to localhost http - but i'd prefer it to stay that way (and i'm not sure whether that would help anyway :) )
Comment 5 Arlo Breault 2014-04-07 16:19:09 UTC
What do you have set in your parsoid configuration?
https://www.mediawiki.org/wiki/Parsoid/Setup#Configuration
Comment 6 richlv 2014-04-07 16:31:05 UTC
that was set to http://localhost/mw/api.php

if i set it to https, in the browser i get :

Error loading data from server: parsoidserver-http-request-error: MWHttpRequest error. Would you like to retry?

and in node.js error :

TypeError: Cannot call method 'substr' of undefined
    at ApiRequest._requestCB (/home/root-rich/files/parsoid/lib/mediawiki.ApiRequest.js:151:37)
    at self.callback (/home/root-rich/files/parsoid/node_modules/request/request.js:129:22)
    at Request.EventEmitter.emit (events.js:95:17)
    at ClientRequest.self.clientErrorHandler (/home/root-rich/files/parsoid/node_modules/request/request.js:239:10)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1547:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at SecurePair.<anonymous> (tls.js:1389:19)
    at SecurePair.EventEmitter.emit (events.js:92:17)
    at SecurePair.maybeInitFinished (tls.js:982:10)
worker 808 died (8), restarting.


(i have set it back to http for now)
Comment 7 Arlo Breault 2014-04-07 16:45:01 UTC
right, you're getting a 404 for https://localhost

try setting that to https://www.zabbix.org/mw/api.php

or, alternatively, when you visit http://localhost/mw/api.php, does that try to redirect you? change your http server configurations to allow non-https connections on localhost
Comment 8 richlv 2014-04-07 17:00:17 UTC
oh, neat - disabling https redirect for localhost seems to have helped, huge thanks.

maybe a bit more friendly error messages can be returned in case of 301/404 errors ?
Comment 9 Arlo Breault 2014-04-07 17:02:51 UTC
yeah, I'm working on that now based on these reports. we've recently changed the way we log data and there're still some bugs.

glad to hear it's working for you.

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


Navigation
Links