Commit ba1d1ee2 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Add distribution image files as empty xml entity if no given

parent bf7a6857
Pipeline #11548 failed with stages
in 3 minutes and 47 seconds
......@@ -142,29 +142,31 @@ class ExtensionIndexService implements LoggerAwareInterface
$reviewState = (string)((int)$extensionVersionArr['review_state'] !== -2 ? $extensionVersionArr['review_state'] : 0);
$versionObj->appendChild(new \DOMElement('reviewstate', $reviewState));
$versionObj->appendChild(new \DOMElement('category', $this->xmlentities((string)$extensionVersionArr['em_category'])));
$distributionImageUrl = '';
$distributionWelcomeImageUrl = '';
if ($extensionVersionArr['em_category'] === 'distribution') {
$prefixDistributionFilePath = $extensionKey[0] . '/' . $extensionKey[1] . '/' . $extensionKey . '_' . $versionNumber . '_';
$distributionImage = $prefixDistributionFilePath . 'Distribution.png';
$distributionWelcomeImage = $prefixDistributionFilePath . 'DistributionWelcome.png';
if (is_file($this->basePath . $distributionImage)) {
$distributionImageUrl = $distributionBaseUrl . $distributionImage;
$versionObj->appendChild(
new \DOMElement(
'distributionImage',
$this->xmlentities($distributionImageUrl)
)
);
}
if (is_file($this->basePath . $distributionWelcomeImage)) {
$distributionWelcomeImageUrl = $distributionBaseUrl . $distributionWelcomeImage;
$versionObj->appendChild(
new \DOMElement(
'distributionImageWelcome',
$this->xmlentities($distributionWelcomeImageUrl)
)
);
}
}
$versionObj->appendChild(
new \DOMElement(
'distributionImage',
$this->xmlentities($distributionImageUrl)
)
);
$versionObj->appendChild(
new \DOMElement(
'distributionImageWelcome',
$this->xmlentities($distributionWelcomeImageUrl)
)
);
$versionObj->appendChild(
new \DOMElement(
'downloadcounter',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment