Last modified: 2012-10-26 21:30:39 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 T39843, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37843 - VisualEditor: Throws error when trying to edit blank (but existing) page
VisualEditor: Throws error when trying to edit blank (but existing) page
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Data Model (Other open bugs)
unspecified
All All
: Unprioritized normal
: VE-deploy-2012-10-29
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-22 18:47 UTC by MZMcBride
Modified: 2012-10-26 21:30 UTC (History)
8 users (show)

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


Attachments

Description MZMcBride 2012-06-22 18:47:18 UTC
I created a blank page at <https://www.mediawiki.org/wiki/VisualEditor:Hello_there>. When I try to edit the page using the VisualEditor extension, I receive the following error: "Error loading data from server: No HTML content in response from server. Would you like to retry?"

I imagine this is a safety check somewhere in the code that needs to be tweaked. If page_len == 0, it isn't always an error. Sometimes a blank page is just a blank page. ;-)
Comment 1 Alex Monk 2012-06-22 18:49:43 UTC
That blank page shouldn't have been possible to create in the first place.
Comment 2 MZMcBride 2012-06-22 21:38:28 UTC
(In reply to comment #1)
> That blank page shouldn't have been possible to create in the first place.

Heh, well I originally created the page as the brand new account I was using to test VisualEditor didn't have the createpage right (for whatever reason).

To be clear, this bug is not about VisualEditor creating a blank page. This bug is about VisualEditor throwing an error when the page length is 0 bytes and the user attempts to edit the page using the VisualEditor interface. <https://www.mediawiki.org/wiki/VisualEditor:Blank_page> is another test case.

For discussion regarding whether MediaWiki should allow users to create blank pages, you want bug 12621. :-)
Comment 3 James Forrester 2012-06-22 22:05:45 UTC
Mass-moving items into VisualEditor product
Comment 4 ssastry 2012-06-23 05:13:05 UTC
Parsoid does handle zero length content -- it returns a zero length HTML response. Right now, VisualEditor extension expects a non-zero HTML response and returns an error if not (line 18 of ApiVisualEditor.php).  This can be verified at this url: https://www.mediawiki.org/w/api.php?action=ve-parsoid&paction=parse&page=VisualEditor%3AHello_there&format=json (for other pages, the result is success with a valid parsed string).  So, either ApiVisualEditor.php has to handle a zero-length response as a valid response, and we need a different way to signal errors from Parsoid, or Parsoid has to always return a non-zero response.   My hunch is that as long as Parsoid returns a 200 OK, ApiVisualEditor accept a zero-length response as a valid response (and if necessary, have sanity checks somewhere -- a non-zero length body should not return a zero-length response, maybe).  Error conditions from Parsoid could be signaled with a different HTTP response code maybe (offhand, 503 is one option). At this time, I am not sure what the right solution is, but hopefully this will help figure out what that might be.
Comment 5 ssastry 2012-06-23 05:40:20 UTC
Actually, I meant 500, not 503.
Comment 6 James Forrester 2012-06-24 19:24:30 UTC
Moving to DM if we're happy with current Parsoid behaviour - to discuss?
Comment 7 Roan Kattouw 2012-10-26 21:05:26 UTC
(In reply to comment #1)
> That blank page shouldn't have been possible to create in the first place.
You can easily create a blank page by first creating a page with content, then blanking it.

(In reply to comment #4)
> Parsoid does handle zero length content -- it returns a zero length HTML
> response. Right now, VisualEditor extension expects a non-zero HTML response
> and returns an error if not (line 18 of ApiVisualEditor.php).  This can be
> verified at this url:
> https://www.mediawiki.org/w/api.php?action=ve-parsoid&paction=parse&page=VisualEditor%3AHello_there&format=json
> (for other pages, the result is success with a valid parsed string).
Thanks Subbu, that's exactly what was going on. Fix submitted in https://gerrit.wikimedia.org/r/30281 .

> So,
> either ApiVisualEditor.php has to handle a zero-length response as a valid
> response, and we need a different way to signal errors from Parsoid, or Parsoid
> has to always return a non-zero response.   My hunch is that as long as Parsoid
> returns a 200 OK, ApiVisualEditor accept a zero-length response as a valid
> response (and if necessary, have sanity checks somewhere -- a non-zero length
> body should not return a zero-length response, maybe).  Error conditions from
> Parsoid could be signaled with a different HTTP response code maybe (offhand,
> 503 is one option). At this time, I am not sure what the right solution is, but
> hopefully this will help figure out what that might be.
I verified that nonexistent pages give me a 404, so I think this is fine. I haven't checked other error conditions because they're nontrivial to reproduce, but as long as Parsoid only returns a 2xx status code when it's actually delivering parsed content and uses 4xx/5xx for errors, I'll be fine.
Comment 8 Trevor Parscal 2012-10-26 21:30:39 UTC
Resolved in gerrit.

Change-Id: I8857d39e1a20080c8419c6165be2b5ad0cdbacd2

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


Navigation
Links