Commit 8005495c authored by Oliver Wand's avatar Oliver Wand

[BUGFIX] Make sure first upload date is used if it exists

parent 16913e6f
Pipeline #3553 passed with stages
in 5 minutes and 8 seconds
......@@ -644,12 +644,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
public function getDateOfFirstUpload()
{
if ($this->versions->count() === 0) {
return null;
$dateOfFirstUpload = null;
$versions = $this->getVersions()->toArray();
list ($firstVersion) = $versions;
if (!empty($firstVersion)) {
$dateOfFirstUpload = date('d-m-Y', $firstVersion->getUploadDate());
}
$firstVersion = $this->getReverseVersionsByVersionNumber(1)[0];
$dateOfFirstUpload = new \DateTime();
$dateOfFirstUpload->setTimestamp($firstVersion->getUploadDate());
return $dateOfFirstUpload;
}
......
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