Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIX: ensure config variables exist

  • Loading branch information...
commit 7a9f142c9752d2b47378d2c2df39e276cae053ff 1 parent 72f8144
@wilr wilr authored
Showing with 15 additions and 6 deletions.
  1. +15 −6 core/manifest/ClassManifest.php
View
21 core/manifest/ClassManifest.php
@@ -248,19 +248,28 @@ public function getConfigs() {
/**
* Returns an array of module names mapped to their paths.
- * "Modules" in SilverStripe are simply directories with a _config.php file.
+ *
+ * "Modules" in SilverStripe are simply directories with a _config.php
+ * file.
*
* @return array
*/
public function getModules() {
$modules = array();
- foreach($this->configs as $configPath) {
- $modules[basename(dirname($configPath))] = dirname($configPath);
+
+ if($this->configs) {
+ foreach($this->configs as $configPath) {
+ $modules[basename(dirname($configPath))] = dirname($configPath);
+ }
}
- foreach($this->configDirs as $configDir) {
- $path = preg_replace('/\/_config$/', '', dirname($configDir));
- $modules[basename($path)] = $path;
+
+ if($this->configDirs) {
+ foreach($this->configDirs as $configDir) {
+ $path = preg_replace('/\/_config$/', '', dirname($configDir));
+ $modules[basename($path)] = $path;
+ }
}
+
return $modules;
}
Please sign in to comment.
Something went wrong with that request. Please try again.