**List of steps to reproduce** (step by step, including full links if applicable):
* Export "File" page with an upload created in 1.38.0-wmf25 (i don't know what version the problem started):
php dumpBackup.php --current --uploads > dump_current.xml
* Look at the produced page in XML, and note that there is no text section in the upload section:
<pre>
<page>
<title>File:Some File</title>
<ns>6</ns>
<id>3066</id>
<revision>
<id>16507</id>
<timestamp>2022-03-16T06:32:33Z</timestamp>
<contributor>
<username>Bob</username>
<id>1</id>
</contributor>
<origin>16507</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="46" sha1="ssycr06m2gygr4osjyial0dxlaqqcrs" xml:space="preserve">
Licenses/Files/User-image</text>
<sha1>ssycr06m2gygr4osjyial0dxlaqqcrs</sha1>
</revision>
<upload>
<timestamp>2022-03-16T06:32:33Z</timestamp>
<contributor>
<username>Bob</username>
<id>1</id>
</contributor>
<comment deleted="deleted" />
<filename>Somefile.png</filename>
<src>https://somedomain.org/mw/images/f/fc/somefile.png</src>
<size>431201</size>
<sha1base36>dmm2v2twthbrentkyyx4rneawvuma89</sha1base36>
<rel>f/fc/Somefile.png</rel>
</upload>
</page>
</pre>
* Import the file using 1.38.0.-wmf26, and note the exception thrown
php importDump.php --uploads --no-updates --username-prefix="SomeUser" dump_current.xml
"MWException from line 1052 of /.../public_html/mediawiki-1.38.0-wmf.26/includes/import/WikiImporter.php: Missing text field in import."
* Add a dummy empty text section to the upload section:
<text bytes="0" sha1="phoiac9h4m842xq45sp7s6u21eteeq1" xml:space="preserve" />
so that:
<upload>
<timestamp>2022-03-16T06:32:33Z</timestamp>
<contributor>
<username>Bob</username>
<id>1</id>
</contributor>
<comment deleted="deleted" />
<filename>Somefile.png</filename>
<src>https://somedomain.org/mw/images/f/fc/somefile.png</src>
<size>431201</size>
<text bytes="0" sha1="phoiac9h4m842xq45sp7s6u21eteeq1" xml:space="preserve" />
<sha1base36>dmm2v2twthbrentkyyx4rneawvuma89</sha1base36>
<rel>f/fc/Somefile.png</rel>
</upload>
* * Import the file using 1.38.0.-wmf26, and note no exception thrown:
php importDump.php --uploads --no-updates --username-prefix="SomeUser" dump_current.xml
"Done!
You might want to run rebuildrecentchanges.php to regenerate RecentChanges,
and initSiteStats.php to update page and revision counts"
**What happens?**:
There is a bug in the importDump.php. It's not going to eat its own dog food in this curcumstance.
**What should have happened instead?**:
It should have either puta text section in the upload section, or not throw for an upload section that doesnt have a text section.
**Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.**: