#25292Exception "tx_em_Parser_MirrorXmlPushParser: Unable to create XML parser" when updating extension list
Description
This happens both when clicking on the Retrieve/Update button in the new extension manager and when using the Update Extension List task in T3 4.5.2 (Side note: I had to fix the requireOnce() call in class.tx_em_parser_mirrorxmlabstractparser.php first, but this is already removed in SVN).
In tx_em_Repository_Utility->updateExtList(), isExtListUpdateNecessary() is called which calls getRemoteExtHashFile(). After this fetchExtListFile() is called which calls getRemoteExtListFile(). Both getRemoteExtHashFile() and getRemoteExtListFile() call getMirrors(TRUE) which result in tx_em_Import_MirrorListImporter->getMirrors() and tx_em_Parser_MirrorXmlPushParser->parseXML() calls.
And here is the source of the problem: The XML parser (objXML member) is created in the constructor of the tx_em_Parser_MirrorXmlPushParser class, but freed at the end of the parseXML() method. Therefore, in the second call to parseXML() objXML is not a resource any more and the exception is thrown.
My current solution is to move the following lines from tx_em_Parser_MirrorXmlPushParser __construct() to the beginning of method parseXML():
if ($this->isAvailable()) {
$this->objXML = xml_parser_create();
xml_set_object($this->objXML, $this);
}
(issue imported from #M17906)
Reviews 4
- TYPO3_4-5 18886[BUGFIX] Make sure XML parser is created everytime when needed
- TYPO3_6-0 18967[BUGFIX] Make sure XML parser is created everytime when needed
- main 18966[BUGFIX] Make sure XML parser is created everytime when needed
- TYPO3_4-7 18965[BUGFIX] Make sure XML parser is created everytime when needed