Page MenuHomePhabricator

Import errors on <restrictions> elements
Closed, ResolvedPublic

Description

Author: mediawiki-bugzilla

Description:
Protected redirects, i.e. articles that contain <redirect /> and <restrictions></restrictions> elements in a dump, cause imports to fail. See the following from the Manual talk page:


I am using 1.15. , and I get the following errors:

<b>Warning</b>: xml_parse() [<a href='function.xml-parse'>function.xml-parse</a>]: Unable to call handler in_() in <b>/home/content/s/h/s/shscentral/html/w/includes/Import.php</b> on line <b>437</b><br />
<br />
<b>Warning</b>: xml_parse() [<a href='function.xml-parse'>function.xml-parse</a>]: Unable to call handler out_() in <b>/home/content/s/h/s/shscentral/html/w/includes/Import.php</b> on line <b>437</b><br />

By analyzing what entries kill the script, I found that it is protected redirects- these errors come when a page has both <redirect /> and the <restrictions></restrictions> lines. Manually removing the restrictions line makes it work. I get these errors both from importdump.php and in my browser window on special:import when there is a protected redirect in the file. 76.244.158.243 02:55, 30 September 2009 (UTC)

I have encountered the same problem. Here are the error messages:


Warning: xml_parse(): Unable to call handler in_() in /usr/share/mediawiki/includes/Import.php on line 437

Call Stack:

0.0023     100896   1. {main}() /usr/share/mediawiki/maintenance/importDump.php:0
0.3745    7977572   2. BackupReader->importFromFile() /usr/share/mediawiki/maintenance/importDump.php:171
0.3747    7978016   3. BackupReader->importFromHandle() /usr/share/mediawiki/maintenance/importDump.php:122
0.3898    8322900   4. WikiImporter->doImport() /usr/share/mediawiki/maintenance/importDump.php:145
0.3903    8364800   5. xml_parse() /usr/share/mediawiki/includes/Import.php:437

Warning: xml_parse(): Unable to call handler out_() in /usr/share/mediawiki/includes/Import.php on line 437

Call Stack:

0.0023     100896   1. {main}() /usr/share/mediawiki/maintenance/importDump.php:0
0.3745    7977572   2. BackupReader->importFromFile() /usr/share/mediawiki/maintenance/importDump.php:171
0.3747    7978016   3. BackupReader->importFromHandle() /usr/share/mediawiki/maintenance/importDump.php:122
0.3898    8322900   4. WikiImporter->doImport() /usr/share/mediawiki/maintenance/importDump.php:145
0.3903    8364800   5. xml_parse() /usr/share/mediawiki/includes/Import.php:437

Removing the <restrictions></restrictions> elements from the XML dump makes the import process work again.


Version: 1.15.x
Severity: normal
URL: http://www.mediawiki.org/wiki/Manual_talk:Importing_XML_dumps#Error_Importing_XML_Files

Details

Reference
bz21000

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport set Reference to bz21000.

Tomasz -- looks like we need to make sure that MediaWiki's import processor (used for Special:Import and importDump.php) is friendly to the new elements we're starting to add in. ISTR the original arch I made for it wasn't very forgiving to unrecognized elements, which kinda sucks.

We might need/want to backport a fix to 1.15 if 1.16's gonna be a while.

  • Bug 23055 has been marked as a duplicate of this bug. ***
ArielGlenn set Security to None.

Importing protected redirects seems to work fine these days.

TTO claimed this task.