Why don’t you use the existing import/export tools?

On Thu, Sep 19, 2019 at 8:18 AM Tom Schulze <
t.schu...@energypedia-consult.com> wrote:

>
> > There have been reports of similar problems with the slots table. Please
> add
> > your experience to the ticket here:
> >
> > https://phabricator.wikimedia.org/T224949
> >
> > There is a patch up that should safeguard against my best guess at the
> cause of
> > this. If you can provide additional insights as to exactly how this may
> happen,
> > please do!
> >
> >
> Thank you for your quick reply and for pointing me to the right
> direction. I am not sure if it's a mistake on my side, otherwise I'll
> gladly contribute.
>
> I assume that the content_model id is lost/not generated somewhere
> between my clean MW install and the import of my templates via a script.
> I import pages using a custom maintenance script which reads a files'
> content from the file system and saves it to the mediawiki db using:
>
> $title = Title::newFromText('Widget:MyWidget');
> $wikiPage = new WikiPage( $title );
> $newContent = ContentHandler::makeContent( $contentFromFile, $title );
> $wikiPage->doEditContent( $newContent );
>
> In the MW Class reference
> <
> https://doc.wikimedia.org/mediawiki-core/master/php/classContentHandler.html#a2f403e52fb305523b0812f37de41622d
> >
> it says  "If [the modelId parameter for ContentHandler::makeContent()
> is] not provided, $title->getContentModel() is used." I assume, that it
> checks the namespace among others and uses javascript for Widgets?
> Because in my case it's a widget that causes the error. The extension is
> installed prior to the importation and the namespace 'Widget' exists.
>
> Is there something wrong with the snippet?
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to