Topic on Extension talk:VisualEditor

Cannot edit subpages

8
Summary by Whatamidoing (WMF)
Prh47bridge (talkcontribs)

I have VisualEditor generally working correctly on my site. However, when I attempt to edit a subpage VisualEditor presents me with a blank page instead of the contents of the page. Looking at the Parsoid log I can see no evidence of any calls to Parsoid relating to the subpage so it appears that it fails to get that far. Looking at my Apache log I can see:

"GET /api/rest_v1/page/html/Page%2FSubpage?redirect=false HTTP/1.1" 404 602 "https://www.mysite.org/wiki/Page/Subpage?action=edit" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"

All other items relating to this page return success and editing the page (rather than the subpage) returns a similar result but with a success code so I'm guessing this is the problem. Any idea why I'm getting a 404 error here and how I fix it?

Thanks in advance for any assistance.

Prh47bridge (talkcontribs)

A bit more information...

Having tried the request to /api/rest_v1/page/html/... from a browser, I find the response is as follows:

Page - the contents of the page as expected

Page/Subpage - the response "{"type":"https://mediawiki.org/wiki/HyperSwitch/errors/bad_request","title":"Invalid parameters","method":"get","detail":"data.params.revision should be an integer","uri":"/www.mysite.org/v1/page/html/Page/Subpage"}"

Page%2FSubpage - "The requested URL /api/rest_v1/page/html/Page/Subpage was not found on this server."

I'm running MediaWiki 1.31, the VisualEditor version tagged for 1.31, Parsoid 0.9.0all and Restbase 0.18.1. My Apache config includes the directive "ProxyPass /api/rest_v1/ http://localhost:7231/www.mysite.org/v1/"

I am unclear why Page/Subpage and Page%2FSubpage produce different results but neither response is correct.

Whatamidoing (WMF) (talkcontribs)
Prh47bridge (talkcontribs)

I've investigated a bit further.

If I use curl to go straight to localhost:7231 I get the following:

Page - the contents of the page as expected

Page/Subpage - the response "{"type":"https://mediawiki.org/wiki/HyperSwitch/errors/bad_request","title":"Invalid parameters","method":"get","detail":"data.params.revision should be an integer","uri":"/www.mysite.org/v1/page/html/Page/Subpage"}"

Page%2FSubpage - the contents of the subpage

This seems to mean that the Page%2FSubpage case is not being handed off correctly to Restbase by Apache. Having checked, it seems VE is using the Page%2FSubpage version. So my guess is that there is a URL-encoding issue here. Any thoughts?

Whatamidoing (WMF) (talkcontribs)

My thought is that I love all the details you've posted, and that it's time to file a bug report. It's up at phab:T201628. You can login (look for the button to login using your MediaWiki.org account) and edit the bug report or add extra information there.

Mobrovac-WMF (talkcontribs)

This does sound like an Apache rewrite rule problem. @Prh47bridge could you please subscribe to the ticket above and include your apache config there?

Prh47bridge (talkcontribs)

I've been on holiday for a couple of weeks. My apache config has now been added to the bug report.

TheROFL98 (talkcontribs)

Hi, I'm getting similar problems as this user. I was looking if there was an update to this problem?

Reply to "Cannot edit subpages"