Page MenuHomeDevCentral

D15.diff
No OneTemporary

D15.diff

diff --git a/includes/workspaces/Workspace.php b/includes/workspaces/Workspace.php
--- a/includes/workspaces/Workspace.php
+++ b/includes/workspaces/Workspace.php
@@ -154,7 +154,8 @@
$file = $Config['Content']['Workspaces'] . '/' . $this->code . '/workspace.conf';
if (!file_exists($file)) {
- throw new Exception("Workspace configuration file doesn't exist");
+ $exceptionMessage = sprintf(Language::get('NotConfiguredWorkspace'), $file);
+ throw new Exception($exceptionMessage);
}
$this->configuration = WorkspaceConfiguration::loadFromFile($file, $context);
diff --git a/index.php b/index.php
--- a/index.php
+++ b/index.php
@@ -37,9 +37,13 @@
Language::load($context)->configLoad('core.conf');
//Loads workspace
-if (Workspace::is_workspace($context->url[0])) {
- $context->workspace = Workspace::fromCode(array_shift($context->url));
- $context->workspace->loadConfiguration($context);
+try {
+ if (Workspace::is_workspace($context->url[0])) {
+ $context->workspace = Workspace::fromCode(array_shift($context->url));
+ $context->workspace->loadConfiguration($context);
+ }
+} catch (Exception $ex) {
+ message_die(GENERAL_ERROR, $ex->getMessage(), Language::get('CantLoadWorkspace'));
}
//Handles login or logout
diff --git a/lang/en/core.conf b/lang/en/core.conf
--- a/lang/en/core.conf
+++ b/lang/en/core.conf
@@ -83,6 +83,13 @@
PickWorkspaceCallForAction = "Great! You have access to several workspaces.<br>Pick the one you want to connect to."
###
+### Workspaces issues
+###
+
+CantLoadWorkspace = "Can't load workspace."
+NotConfiguredWorkspace = "Workspace configuration file %s doesn't exist. If you've created a new workspace, you need to create a configuration file with the core properties."
+
+###
### Disclaimers
###
diff --git a/lang/fr/core.conf b/lang/fr/core.conf
--- a/lang/fr/core.conf
+++ b/lang/fr/core.conf
@@ -82,6 +82,13 @@
PickWorkspaceCallForAction = "Vous disposez d'un accès à plusieurs espaces de travail.<br>Veuillez sélectionner celui sur lequel vous souhaitez vous connecter."
###
+### Workspaces issues
+###
+
+CantLoadWorkspace = Votre espace de travail est momentanément indisponible
+NotConfiguredWorkspace = "Le fichier de configuration de cet espace de travail n'existe pas. Si vous venez d'ajouter cet espace, créez un fichier %s et ajoutez-y les propriétés de l'espace."
+
+###
### Disclaimers
###

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 11:54 (19 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2252458
Default Alt Text
D15.diff (2 KB)

Event Timeline