Skip to content

Commit

Permalink
Fix legacy mapper exceptions when there is no database (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric authored and andrerom committed Feb 10, 2017
1 parent 09ac6da commit 7f6b0aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bundle/LegacyMapper/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use RuntimeException;
use Exception;

/**
* Maps configuration parameters to the legacy parameters.
Expand Down Expand Up @@ -281,7 +282,16 @@ private function getMultiSiteSettings()
return $result;
}

$pathPrefix = trim($this->urlAliasGenerator->getPathPrefixByRootLocationId($rootLocationId), '/');
$pathPrefix = '';

try {
$pathPrefix = trim($this->urlAliasGenerator->getPathPrefixByRootLocationId($rootLocationId), '/');
} catch (Exception $e) {
// Ignore any errors
// Most probable cause for error is database not being ready yet,
// i.e. initial install of the project which includes eZ Publish Legacy
}

$pathPrefixExcludeItems = array_map(
function ($value) {
return trim($value, '/');
Expand Down

0 comments on commit 7f6b0aa

Please sign in to comment.