Skip to content

Commit

Permalink
NoDomainSelectedException is no longer throwned during maintenance on…
Browse files Browse the repository at this point in the history
… page
  • Loading branch information
TomasLudvik committed Dec 19, 2024
1 parent 3449c71 commit 0575ec7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Component/Collector/ShopsysFrameworkDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use PharIo\Version\Version;
use Shopsys\FrameworkBundle\Component\Domain\Domain;
use Shopsys\FrameworkBundle\Component\Domain\Exception\NoDomainSelectedException;
use Shopsys\FrameworkBundle\Component\Localization\DisplayTimeZoneProviderInterface;
use Shopsys\FrameworkBundle\ShopsysFrameworkBundle;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -34,12 +35,17 @@ public function collect(Request $request, Response $response, ?Throwable $except
'version' => ShopsysFrameworkBundle::VERSION,
'docsVersion' => $this->resolveDocsVersion(ShopsysFrameworkBundle::VERSION),
'domains' => $this->domain->getAll(),
'currentDomainId' => $this->domain->getId(),
'currentDomainName' => $this->domain->getName(),
'currentDomainLocale' => $this->domain->getLocale(),
'systemTimeZone' => date_default_timezone_get(),
'displayTimeZone' => $this->displayTimeZoneProvider->getDisplayTimeZoneByDomainId($this->domain->getId())->getName(),
];

try {
$this->data['currentDomainId'] = $this->domain->getId();
$this->data['currentDomainName'] = $this->domain->getName();
$this->data['currentDomainLocale'] = $this->domain->getLocale();
$this->data['displayTimeZone'] = $this->displayTimeZoneProvider->getDisplayTimeZoneByDomainId($this->domain->getId())->getName();
} catch (NoDomainSelectedException) {
return;
}
}

/**
Expand Down

0 comments on commit 0575ec7

Please sign in to comment.