Content model change to "Page: page" does not work
Closed, ResolvedPublic

Description

It seems that changing content model from eg. "wikitext" to "Page: page" for pages in Page namespace no longer works.

While attempting the change I get an empty page (with no HTML at all) and no evidence about the attempt in available logs (the page content model remains unchanged).

Tested on plwikisource and sourceswiki. The MediaWIki behaviour is the same if the page already contains a ProofreadPage header/footer as if it does not contain any.

This used to work at least in enwikisource, as the following log shows:
https://en.wikisource.org/w/index.php?title=Special:Log&type=contentmodel&user=Mpaa
so I assume it is regression of MediaWiki functionality introduced in the meantime.

Ankry created this task.Jan 15 2017, 6:31 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 15 2017, 6:31 PM
Ankry renamed this task from Content model change tp "Page: page" does not work to Content model change to "Page: page" does not work.Jan 15 2017, 6:31 PM

Same problem at enWS, where they clearly don't work anymore.

When I put the console on from page information and attempt to change it I get the following:

  • Page: page

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

NO issue changing to plain text.

While attempting the change I get an empty page (with no HTML at all) and no evidence about the attempt in available logs (the page content model remains unchanged).

Sounds like a PHP fatal. https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms#You_see_a_Blank_Page I'm looking for this in the server logs.

Example page that fails (thanks Ankry): https://pl.wikisource.org/wiki/Specjalna:ChangeContentModel/Strona:Zabytek_Dawnej_Mowy_Polskiej.djvu/4

[43ebf695] PHP Fatal Error: Call to undefined method WikitextContent::getLevel()

Backtrace:

{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/extensions/ProofreadPage/ProofreadPage.body.php",
  "line": 618
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/Hooks.php",
  "line": 195,
  "function": "onEditFilterMergedContent",
  "class": "ProofreadPage",
  "type": "::",
  "args": [
    "DerivativeContext",
    "ProofreadPage\\Page\\PageContent",
    "Status",
    "string",
    "User",
    "boolean"
  ]
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/specials/SpecialChangeContentModel.php",
  "line": 241,
  "function": "run",
  "class": "Hooks",
  "type": "::",
  "args": [
    "string",
    "array"
  ]
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/htmlform/HTMLForm.php",
  "line": 662,
  "function": "onSubmit",
  "class": "SpecialChangeContentModel",
  "type": "->",
  "args": [
    "array",
    "OOUIHTMLForm"
  ]
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/htmlform/HTMLForm.php",
  "line": 554,
  "function": "trySubmit",
  "class": "HTMLForm",
  "type": "->",
  "args": []
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/htmlform/HTMLForm.php",
  "line": 569,
  "function": "tryAuthorizedSubmit",
  "class": "HTMLForm",
  "type": "->",
  "args": []
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/specialpage/FormSpecialPage.php",
  "line": 155,
  "function": "show",
  "class": "HTMLForm",
  "type": "->",
  "args": []
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/specialpage/SpecialPage.php",
  "line": 522,
  "function": "execute",
  "class": "FormSpecialPage",
  "type": "->",
  "args": [
    "string"
  ]
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/specialpage/SpecialPageFactory.php",
  "line": 577,
  "function": "run",
  "class": "SpecialPage",
  "type": "->",
  "args": [
    "string"
  ]
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/MediaWiki.php",
  "line": 283,
  "function": "executePath",
  "class": "SpecialPageFactory",
  "type": "::",
  "args": [
    "Title",
    "RequestContext"
  ]
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/MediaWiki.php",
  "line": 858,
  "function": "performRequest",
  "class": "MediaWiki",
  "type": "->",
  "args": []
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/includes/MediaWiki.php",
  "line": 519,
  "function": "main",
  "class": "MediaWiki",
  "type": "->",
  "args": []
},
{
  "file": "/srv/mediawiki/php-1.29.0-wmf.7/index.php",
  "line": 43,
  "function": "run",
  "class": "MediaWiki",
  "type": "->",
  "args": []
},
{
  "file": "/srv/mediawiki/w/index.php",
  "line": 3,
  "function": "include",
  "args": [
    "string"
  ]
}

Looks like ProofreadPage is implicated, but I have no idea if this is caused by a change in MW core that is incompatible with ProofreadPage, or a change in ProofreadPage that is incompatible with core.

Ankry added a subscriber: Tpt.Jan 17 2017, 7:29 PM

Change 332551 had a related patch set uploaded (by Tpt):
EditFilterMergedContent hook should not fail if the previous content has a different model

https://gerrit.wikimedia.org/r/332551

Tpt added a comment.Jan 17 2017, 8:31 PM

EditFilterMergedContent hook is now fired by Special:ChangeContentModel (see task T145489). And the implementation of this hook in ProofreadPage does not handle well content conversion. I'm working on that.

@Tpt @Ankry Should this be backported and deployed today? We missed the wmf.8 branch cut, but I could schedule it for a SWAT deployment later today.

Change 332551 merged by Bartosz Dziewoński:
EditFilterMergedContent hook should not fail if the previous content has a different model

https://gerrit.wikimedia.org/r/332551

matmarex closed this task as Resolved.Jan 17 2017, 9:48 PM
matmarex assigned this task to Tpt.
matmarex removed a project: Patch-For-Review.
Tpt added a comment.Jan 18 2017, 11:37 AM

Should this be backported and deployed today? We missed the wmf.8 branch cut, but I could schedule it for a SWAT deployment later today.

It seems that it's broken since September and the issue has been reported 3 month later. So, I believe the correcting change could wait a few days.

Billinghurst moved this task from Backlog to Done on the ProofreadPage board.Mar 5 2017, 2:04 AM