Improve failure tolerance of contingent import service
This commit is contained in:
@@ -143,6 +143,9 @@ class ContingentImportService implements SingletonInterface, LoggerAwareInterfac
|
||||
public function loadXmlFile($file): ?\SimpleXMLElement
|
||||
{
|
||||
libxml_use_internal_errors (true);
|
||||
if (!file_exists($file)) {
|
||||
return null;
|
||||
}
|
||||
/** @var \SimpleXMLElement $xmlData */
|
||||
if (!$xmlData = simplexml_load_string(file_get_contents($file))) {
|
||||
libxml_clear_errors();
|
||||
@@ -210,7 +213,9 @@ class ContingentImportService implements SingletonInterface, LoggerAwareInterfac
|
||||
if ($xmlContingent->idbuspro_kontingent_aus) {
|
||||
$linkedProductId = (int)$xmlContingent->idbuspro_kontingent_aus;
|
||||
$path = GeneralUtility::getFileAbsFileName(self::XML_PATH);
|
||||
$xmlContingent = $this->loadXmlFile(sprintf('%s/HotelZimmer_%d.xml', $path, $linkedProductId));
|
||||
if (null === $xmlContingent = $this->loadXmlFile(sprintf('%s/HotelZimmer_%d.xml', $path, $linkedProductId))) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($xmlContingent->kapazitaeten)) {
|
||||
|
||||
Reference in New Issue
Block a user