File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1111namespace Magefan \HtmlSitemap \Model ;
1212
1313use Magento \Framework \App \Config \ScopeConfigInterface ;
14+ use Magento \Framework \Module \ModuleListInterface ;
1415use Magento \Store \Model \ScopeInterface ;
1516
1617class Config
@@ -56,13 +57,21 @@ class Config
5657 private $ ignoredLinks ;
5758
5859 /**
59- * Config constructor.
60+ * @var ModuleListInterface
61+ */
62+ private $ moduleList ;
63+
64+ /**
6065 * @param ScopeConfigInterface $scopeConfig
66+ * @param ModuleListInterface|null $moduleList
6167 */
6268 public function __construct (
63- ScopeConfigInterface $ scopeConfig
69+ ScopeConfigInterface $ scopeConfig ,
70+ ModuleListInterface $ moduleList = null
6471 ) {
6572 $ this ->scopeConfig = $ scopeConfig ;
73+ $ this ->moduleList = $ moduleList ?: \Magento \Framework \App \ObjectManager::getInstance ()
74+ ->get (ModuleListInterface::class);
6675 }
6776
6877 /**
@@ -131,7 +140,8 @@ public function getIgnoredLinks($storeId = null, $toUrlKeys = true)
131140 */
132141 public function isBlogEnabled ($ storeId = null )
133142 {
134- return (bool )$ this ->getConfig (self ::XML_PATH_BLOG_EXTENSION_ENABLED , $ storeId );
143+ return $ this ->getConfig (self ::XML_PATH_BLOG_EXTENSION_ENABLED , $ storeId )
144+ && $ this ->moduleList ->getOne ('Magefan_Blog ' );
135145 }
136146
137147 /**
You can’t perform that action at this time.
0 commit comments