|
|
@@ -3,6 +3,7 @@
|
|
|
namespace Opentalent\OtCore\Website;
|
|
|
|
|
|
use Opentalent\OtCore\Exception\InvalidWebsiteConfigurationException;
|
|
|
+use Opentalent\OtCore\Exception\NoSuchRecordException;
|
|
|
use Opentalent\OtCore\Exception\NoSuchWebsiteException;
|
|
|
use Opentalent\OtCore\Utility\RouteNormalizer;
|
|
|
use Symfony\Component\Yaml\Yaml;
|
|
|
@@ -111,7 +112,7 @@ class OtWebsiteRepository
|
|
|
->execute()
|
|
|
->fetch();
|
|
|
if (!isset($website['uid'])) {
|
|
|
- throw new NoSuchWebsiteException('No website found for page ' . $pageUid);
|
|
|
+ throw new NoSuchWebsiteException('No website found for identifier ' . $identifier);
|
|
|
}
|
|
|
return $website;
|
|
|
}
|
|
|
@@ -128,13 +129,17 @@ class OtWebsiteRepository
|
|
|
if (!$withRestrictions) {
|
|
|
$queryBuilder->getRestrictions()->removeAll();
|
|
|
}
|
|
|
- return $queryBuilder
|
|
|
+ $rootUid = $queryBuilder
|
|
|
->select('uid')
|
|
|
->from('pages')
|
|
|
->where($queryBuilder->expr()->eq('ot_website_uid', $websiteUid))
|
|
|
->andWhere($queryBuilder->expr()->eq('is_siteroot', 1))
|
|
|
->execute()
|
|
|
->fetchColumn(0);
|
|
|
+ if (!$rootUid > 0) {
|
|
|
+ throw new NoSuchRecordException('No root page found for website ' . $websiteUid);
|
|
|
+ }
|
|
|
+ return $rootUid;
|
|
|
}
|
|
|
|
|
|
/**
|