|
|
@@ -1334,7 +1334,6 @@ class SiteController extends ActionController
|
|
|
* @param string $newDomain
|
|
|
* @param bool $redirect
|
|
|
* @return int
|
|
|
- * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
|
|
|
* @throws NoSuchWebsiteException
|
|
|
* @throws \Opentalent\OtCore\Exception\InvalidWebsiteConfigurationException
|
|
|
*/
|
|
|
@@ -1870,7 +1869,8 @@ class SiteController extends ActionController
|
|
|
* Insert the root page of a new organization's website
|
|
|
* and return its uid
|
|
|
*
|
|
|
- * @param Organization $organization
|
|
|
+ * @param int $website_uid
|
|
|
+ * @param string $title
|
|
|
* @return int
|
|
|
*/
|
|
|
private function insertRootPage(int $website_uid, string $title): int
|
|
|
@@ -1883,9 +1883,7 @@ class SiteController extends ActionController
|
|
|
self::TEMPLATE_HOME,
|
|
|
[
|
|
|
'is_siteroot' => 1,
|
|
|
- 'TSconfig' => 'TCAdefaults.pages.ot_website_uid=' . $website_uid,
|
|
|
- 'tx_opentalent_template' => self::DEFAULT_THEME,
|
|
|
- 'tx_opentalent_template_preferences' => '{"themeColor":"' . self::DEFAULT_COLOR . '","displayCarousel":"1"}'
|
|
|
+ 'TSconfig' => 'TCAdefaults.pages.ot_website_uid=' . $website_uid
|
|
|
]
|
|
|
);
|
|
|
}
|
|
|
@@ -2046,6 +2044,7 @@ class SiteController extends ActionController
|
|
|
|
|
|
/**
|
|
|
* Create or update the .../sites/.../config.yaml file of the given site
|
|
|
+ * Return the identifier of the created website
|
|
|
*
|
|
|
* @param int $organizationId
|
|
|
* @param int $rootUid
|
|
|
@@ -2061,7 +2060,8 @@ class SiteController extends ActionController
|
|
|
$subdomain = explode('.', $domain)[0];
|
|
|
|
|
|
if (!$configFilename) {
|
|
|
- $configDir = $_ENV['TYPO3_PATH_APP'] . "/config/sites/" . $subdomain . '_' . $organizationId;
|
|
|
+ $identifier = $subdomain . '_' . $organizationId;
|
|
|
+ $configDir = $_ENV['TYPO3_PATH_APP'] . "/config/sites/" . $identifier;
|
|
|
$configFilename = $configDir . "/config.yaml";
|
|
|
$isNew = true;
|
|
|
|
|
|
@@ -2070,6 +2070,7 @@ class SiteController extends ActionController
|
|
|
}
|
|
|
} else {
|
|
|
$configDir = dirname($configFilename);
|
|
|
+ $identifier = basename($configDir);
|
|
|
$config['base'] = 'https://' . $domain;
|
|
|
$isNew = false;
|
|
|
}
|
|
|
@@ -2115,6 +2116,14 @@ class SiteController extends ActionController
|
|
|
}
|
|
|
$this->writeFile($configFilename, $yamlConfig);
|
|
|
|
|
|
+ // Update the identifier in the ot_websites table
|
|
|
+ $queryBuilder = $this->connectionPool->getQueryBuilderForTable('ot_websites');
|
|
|
+ $queryBuilder
|
|
|
+ ->update('ot_websites')
|
|
|
+ ->where($queryBuilder->expr()->eq('organization_id', $organizationId))
|
|
|
+ ->set('config_identifier', $identifier)
|
|
|
+ ->execute();
|
|
|
+
|
|
|
// Set the owner and mods, in case www-data is not the one who run this command
|
|
|
// @see https://www.php.net/manual/fr/function.stat.php
|
|
|
try {
|