Commit 819c6a36 authored by Tino Goratsch's avatar Tino Goratsch

various bug fixes and improvements

parent faaa291e
......@@ -14,7 +14,7 @@ interface BootstrapInterface extends HttpKernelInterface
/**
* Contains the current ACP3 version string
*/
const VERSION = '4.0.0-rc.11';
const VERSION = '4.0.0-rc.12';
/**
* Performs some startup checks
......
......@@ -158,7 +158,7 @@ class ModuleInfoCache
'name' => $this->getModuleName($moduleInfo, $moduleName),
'categories' => isset($moduleInfo['categories']),
'protected' => isset($moduleInfo['protected']),
'dependencies' => array_values($this->xml->parseXmlFile($path, 'info/dependencies')),
'dependencies' => $this->getModuleDependencies($path),
];
}
}
......@@ -196,4 +196,19 @@ class ModuleInfoCache
return $moduleInfo['name'];
}
/**
* @param string $path
* @return array
*/
protected function getModuleDependencies($path)
{
$dependencies = $this->xml->parseXmlFile($path, '/module/info/dependencies');
if (isset($dependencies['module'])) {
return is_array($dependencies['module']) ? $dependencies['module'] : [$dependencies['module']];
}
return [];
}
}
......@@ -44,7 +44,7 @@ class DuplicateCategoryValidationRule extends AbstractValidationRule
'category_id' => ''
], $extra);
return $this->categoriesHelper->categoryIsDuplicate(
return !$this->categoriesHelper->categoryIsDuplicate(
$data,
$params['module_id'],
$params['category_id']
......
......@@ -128,7 +128,8 @@ class Installer
$path = $this->appPath->getModulesDir() . $vendor . '/' . ucfirst($moduleName) . '/Resources/config/module.xml';
if (is_file($path) === true) {
return array_values($this->xml->parseXmlFile($path, '/module/info/dependencies'));
$dependencies = $this->xml->parseXmlFile($path, '/module/info/dependencies');
return is_array($dependencies['module']) ? $dependencies['module'] : [$dependencies['module']];
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment