Commit 16ec1025 authored by Tino Goratsch's avatar Tino Goratsch

fixes #70

- Fixed the sitemap generation with present, but not installed modules
parent b9da420a
......@@ -17,6 +17,8 @@ services:
seo.utility.sitemap_availability_registrar:
class: ACP3\Modules\ACP3\Seo\Utility\SitemapAvailabilityRegistrar
arguments:
- '@core.modules'
seo.sitemap_logger:
class: Psr\Log\LoggerInterface
......
......@@ -6,6 +6,7 @@
namespace ACP3\Modules\ACP3\Seo\Utility;
use ACP3\Core\Modules;
use ACP3\Modules\ACP3\Seo\Extension\SitemapAvailabilityExtensionInterface;
class SitemapAvailabilityRegistrar
......@@ -14,13 +15,28 @@ class SitemapAvailabilityRegistrar
* @var SitemapAvailabilityExtensionInterface[]
*/
protected $availableModules = [];
/**
* @var Modules
*/
private $modules;
/**
* SitemapAvailabilityRegistrar constructor.
* @param Modules $modules
*/
public function __construct(Modules $modules)
{
$this->modules = $modules;
}
/**
* @param SitemapAvailabilityExtensionInterface $availability
*/
public function registerModule(SitemapAvailabilityExtensionInterface $availability)
{
$this->availableModules[$availability->getModuleName()] = $availability;
if ($this->modules->isActive($availability->getModuleName())) {
$this->availableModules[$availability->getModuleName()] = $availability;
}
}
/**
......
......@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Fixed the bug that it was not possible to create new articles when the menu items module was installed and active, but there were no menus at all
- [#70](https://github.com/ACP3/cms/issues/70) Fixed the sitemap generation with present, but not installed modules
## [4.16.0] - 2017-10-24
### Added
......
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