Page MenuHomePhabricator

Importing a module sabotages it (got content model set to "wikitext" rather than "Scribunto")
Closed, ResolvedPublic

Description

I've just imported
https://fr.wikiversity.org/wiki/Module:Wikidata
from
https://fr.wikipedia.org/wiki/Module:Wikidata
and it was not displayed as a module but as an article, even when I emptied my cache.

I've renamed it Module:Wikidata/Bug and pasted its content into Module:Wikidata and then it worked.
So I tried to merge their histories, but it failed again.
Finally I've let the history into Module:Wikidata/Bug, if you can merge it...

Event Timeline

JackPotte raised the priority of this task from to Normal.
JackPotte updated the task description. (Show Details)
JackPotte added a subscriber: JackPotte.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 28 2015, 4:08 PM
JackPotte updated the task description. (Show Details)Feb 28 2015, 4:08 PM
JackPotte set Security to None.
Anomie added a subscriber: Anomie.Feb 28 2015, 7:22 PM

Somehow it got its content model set to "wikitext" rather than "Scribunto".

Also happens in several other transwikied modules:
https://www.wikidata.org/wiki/Module:Citation/CS1
https://www.wikidata.org/wiki/Module:Arguments

but some modules works well:
https://zh.wikivoyage.org/wiki/%E6%A8%A1%E5%9D%97:CGroup

Importupload worked:
https://zh.wikivoyage.org/wiki/%E6%A8%A1%E5%9D%97:China_Expwy_Name

But I get a error while using importupload, and only one module imported while importing files with several modules.

Addition: CodeEditor works if editing such modules.

Aklapper renamed this task from Importing a module sabotages it to Importing a module sabotages it (got content model set to "wikitext" rather than "Scribunto").Mar 2 2015, 7:39 AM
SamB added a subscriber: SamB.May 14 2015, 9:11 PM

Something like http://quarry.wmflabs.org/query/3610 could be useful to find pages like this on any given wiki; unfortunately, quarry doesn't support just running the same query against a different wiki.

This had happened again on the bunch of modules I've just imported into the French Wiktionary, eg:
https://fr.wiktionary.org/wiki/Module:script_utilities

No because I can save the pages, it's an interpretation problem.

One page left at https://www.wikidata.org/wiki/Module:RFBOT/testcases . https://www.wikidata.org/w/index.php?title=Module:RFBOT/testcases&action=edit gives a nice fatality:

[a822ae7c] 2015-07-29 20:41:37: Fatal exception of type MWException

Legoktm claimed this task.Jul 29 2015, 8:51 PM
Legoktm raised the priority of this task from Normal to Unbreak Now!.

So, imported modules with a content model of "wikitext" are now breaking.

Yeah, that was me. The content model on that page needs fixed back to wikitext.

Legoktm lowered the priority of this task from Unbreak Now! to High.Jul 29 2015, 11:41 PM

With help from @Jackmcbarn, I ran a script that fixed 435 modules across all wikis. I unfortunately can't publish a log since it contains private wikis, but you can just stalk my global contributions.

Lowering priority to "High" for underlying import bug.

Legoktm removed Legoktm as the assignee of this task.Jul 29 2015, 11:41 PM

Thanks a lot Legoktm, I need to know if you got the notification from
https://fr.wikiversity.org/wiki/Discussion_utilisateur:Legoktm
because there may be some new modules to repair in the next future (including one since today).

I used w:Module:Bananas as my test module:

  • Exporting as XML and importing to my local development wiki works fine
  • Cross-wiki import to my local dev wiki works fine
  • Cross-wiki import to test.wikipedia.org breaks.

So, something is different about my setup versus production? Or some other extension is breaking things?

Legoktm claimed this task.Jul 31 2015, 11:56 PM

Aaaand think I found it. Revision::newNullRevision sets content_model to what was previously in the database, which is NULL since it's the default, so Revision::getContentModel looks at the title to set the content model. Here it uses the slave database, which presumably doesn't have the new page yet (which is why it worked on my local wiki), so no title is set, and it defaults to wikitext. Fix is rather simple, uploading a patch.

Change 228432 had a related patch set uploaded (by Legoktm):
Revision::newNullRevision: Make sure the Title is set in the constructor

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

Thanks a lot Legoktm, I need to know if you got the notification from
https://fr.wikiversity.org/wiki/Discussion_utilisateur:Legoktm
because there may be some new modules to repair in the next future (including one since today).

I ran the script on frwikiversity again. Module imports will continue to be broken until my patch is merged and deployed. In the meantime, find me on IRC (#wikimedia-tech, nick "legoktm") or leave a comment here and I can fix them manually.

Change 228432 merged by jenkins-bot:
Revision::newNullRevision: Make sure the Title is set in the constructor

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

TTO closed this task as Resolved.Aug 1 2015, 1:29 AM
TTO added a subscriber: TTO.

Confirmed fixed on beta.

Change 228853 had a related patch set uploaded (by Legoktm):
Revision::newNullRevision: Make sure the Title is set in the constructor

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

Change 228853 merged by jenkins-bot:
Revision::newNullRevision: Make sure the Title is set in the constructor

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

I backported and deployed the fix, confirmed that importing https://test.wikipedia.org/wiki/Module:Bananas worked properly.

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptFri, Nov 1, 9:10 PM