Last modified: 2011-04-05 16:15:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 28417 - Undefined index: id in includes/Import.php on line 549, clarify the XSD file
Undefined index: id in includes/Import.php on line 549, clarify the XSD file
Product: MediaWiki
Classification: Unclassified
Documentation (Other open bugs)
All All
: Normal trivial (vote)
: ---
Assigned To: Brion Vibber
Depends on:
  Show dependency treegraph
Reported: 2011-04-04 14:13 UTC by Dan Jacobson
Modified: 2011-04-05 16:15 UTC (History)
0 users

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


Description Dan Jacobson 2011-04-04 14:13:46 UTC
On line 127 of docs/export-0.5.xsd one sees
 <element name="id" type="positiveInteger" minOccurs="0"/>
However omitting such items in an XML to be imported will cause
 Notice: Undefined index: id in includes/Import.php on line 549
warnings, despite the minOccurs="0".

I recommend you document there in export-*.xsd, just exactly what
numbers you would like a person creating an XML file by hand for import to
use, if you insist on him giving such fields.

And mention what numbers are safe to use, and what numbers might
overwrite something with the same number, and if one is not to worry
about overwriting, then why can't he just not supply the various XML
<id> lines in the first place.

And even the Timestamp line. Mention why and if this is mandatory.

Same with all the other lines that might still make sense to be omitted when
handcrafting an XML file for import.
Comment 1 Brion Vibber 2011-04-04 18:53:57 UTC
The xsd looks correct here; the error message looks like it's just some sloppy code.
Comment 2 Brion Vibber 2011-04-04 19:06:42 UTC
Fixed on trunk (for 1.18) in r85362.

Be warned that the log import code may have similar issues if its input isn't validated properly.
Comment 3 Dan Jacobson 2011-04-05 00:59:11 UTC
Here's the usual scenario:
The user exports ten pages into one xml file.
Then he does s/bla bla/mla mla/ on the file.
Then he reimports it back in.
The he checks recentchanges to find most or all of his changes didn't
show up.
So then he tinkers with the <timestamp>s, and reimports again. Maybe
it will work this time.
What he really wants is an explicit statement there offline saying
just what <id> etc. he can remove, or why and what timestamp
adjustment he needs, to get his import imported. Its all undocumented
black magic currently.
Comment 4 Brion Vibber 2011-04-05 16:00:28 UTC
As previpusly mentioned, id is not required. The xsd is correct, and the sloppy code is fixed on trunk. Is there any other specific documentation that needs fixing?
Comment 5 Dan Jacobson 2011-04-05 16:15:57 UTC
Why is timestamp required upon import? Why can't the system choose it
for us like it can the id?

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