|
|
@@ -1633,14 +1633,19 @@ class SiteController extends ActionController
|
|
|
{
|
|
|
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('pages');
|
|
|
$queryBuilder->getRestrictions()->removeAll();
|
|
|
- $rootUid = $queryBuilder
|
|
|
+ $rows = $queryBuilder
|
|
|
->select('uid')
|
|
|
->from('pages')
|
|
|
->where('is_siteroot=1')
|
|
|
->andWhere($queryBuilder->expr()->eq('tx_opentalent_structure_id', $organizationId))
|
|
|
->execute()
|
|
|
- ->fetchColumn(0);
|
|
|
+ ->fetchAll();
|
|
|
+
|
|
|
+ if (count($rows) > 1) {
|
|
|
+ throw new \RuntimeException("More than one website match this organization id");
|
|
|
+ }
|
|
|
|
|
|
+ $rootUid = (int)$rows[0]['uid'];
|
|
|
if ($rootUid > 0) {
|
|
|
return $rootUid;
|
|
|
}
|