Skip to content

Commit 206379a

Browse files
author
Eric Bohanon
committed
MAGETWO-71257: Need to disable module output by configuration
- Fix deprecation tags
1 parent ff4840e commit 206379a

File tree

4 files changed

+84
-27
lines changed

4 files changed

+84
-27
lines changed

app/code/Magento/Backend/Block/Template.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public function getFormKey()
8484
*
8585
* @param string $moduleName Full module name
8686
* @return boolean
87+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
88+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
89+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
90+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
91+
* issues that will be addressed in future releases.
8792
*/
8893
public function isOutputEnabled($moduleName = null)
8994
{

lib/internal/Magento/Framework/Module/Manager.php

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,28 @@ class Manager
2121
{
2222
/**
2323
* @var Output\ConfigInterface
24+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
25+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
26+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
27+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
28+
* issues that will be addressed in future releases.
2429
*/
25-
private $_outputConfig;
30+
private $outputConfig;
2631

2732
/**
2833
* @var ModuleListInterface
2934
*/
30-
private $_moduleList;
35+
private $moduleList;
3136

3237
/**
3338
* @var array
39+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
40+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
41+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
42+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
43+
* issues that will be addressed in future releases.
3444
*/
35-
private $_outputConfigPaths;
45+
private $outputConfigPaths;
3646

3747
/**
3848
* @param Output\ConfigInterface $outputConfig
@@ -44,9 +54,9 @@ public function __construct(
4454
ModuleListInterface $moduleList,
4555
array $outputConfigPaths = []
4656
) {
47-
$this->_outputConfig = $outputConfig;
48-
$this->_moduleList = $moduleList;
49-
$this->_outputConfigPaths = $outputConfigPaths;
57+
$this->outputConfig = $outputConfig;
58+
$this->moduleList = $moduleList;
59+
$this->outputConfigPaths = $outputConfigPaths;
5060
}
5161

5262
/**
@@ -57,43 +67,46 @@ public function __construct(
5767
*/
5868
public function isEnabled($moduleName)
5969
{
60-
return $this->_moduleList->has($moduleName);
70+
return $this->moduleList->has($moduleName);
6171
}
6272

6373
/**
6474
* Whether a module output is permitted by the configuration or not
6575
*
6676
* @param string $moduleName Fully-qualified module name
6777
* @return boolean
78+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
79+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
80+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
81+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
82+
* issues that will be addressed in future releases.
6883
*/
6984
public function isOutputEnabled($moduleName)
7085
{
71-
if (!$this->isEnabled($moduleName)) {
72-
return false;
73-
}
74-
if (!$this->_isCustomOutputConfigEnabled($moduleName)) {
75-
return false;
76-
}
77-
if ($this->_outputConfig->isEnabled($moduleName)) {
78-
return false;
79-
}
80-
return true;
86+
return $this->isEnabled($moduleName)
87+
&& $this->_isCustomOutputConfigEnabled($moduleName)
88+
&& !$this->outputConfig->isEnabled($moduleName);
8189
}
8290

8391
/**
8492
* Whether a configuration switch for a module output permits output or not
8593
*
8694
* @param string $moduleName Fully-qualified module name
8795
* @return boolean
96+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
97+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
98+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
99+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
100+
* issues that will be addressed in future releases.
88101
*/
89102
protected function _isCustomOutputConfigEnabled($moduleName)
90103
{
91-
if (isset($this->_outputConfigPaths[$moduleName])) {
92-
$configPath = $this->_outputConfigPaths[$moduleName];
104+
if (isset($this->outputConfigPaths[$moduleName])) {
105+
$configPath = $this->outputConfigPaths[$moduleName];
93106
if (defined($configPath)) {
94107
$configPath = constant($configPath);
95108
}
96-
return $this->_outputConfig->isSetFlag($configPath);
109+
return $this->outputConfig->isSetFlag($configPath);
97110
}
98111
return true;
99112
}

lib/internal/Magento/Framework/Module/Output/Config.php

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,42 @@
77
*/
88
namespace Magento\Framework\Module\Output;
99

10+
/**
11+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
12+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
13+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
14+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
15+
* issues that will be addressed in future releases.
16+
*/
1017
class Config implements \Magento\Framework\Module\Output\ConfigInterface
1118
{
1219
/**
1320
* XPath in the configuration where module statuses are stored
14-
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
21+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
22+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
23+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
24+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
25+
* issues that will be addressed in future releases.
1526
*/
1627
const XML_PATH_MODULE_OUTPUT_STATUS = 'advanced/modules_disable_output/%s';
1728

1829
/**
1930
* @var \Magento\Framework\App\Config\ScopeConfigInterface
20-
* @deprecated 100.2.0 Magento does not support custom disabling/enabling module output since 2.2.0 version
31+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
32+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
33+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
34+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
35+
* issues that will be addressed in future releases.
2136
*/
2237
protected $_scopeConfig;
2338

2439
/**
2540
* @var string
26-
* @deprecated 100.2.0 Magento does not support custom disabling/enabling module output since 2.2.0 version
41+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
42+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
43+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
44+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
45+
* issues that will be addressed in future releases.
2746
*/
2847
protected $_storeType;
2948

@@ -43,7 +62,11 @@ public function __construct(
4362
* Whether a module is enabled in the configuration or not
4463
*
4564
* @param string $moduleName Fully-qualified module name
46-
* @deprecated 100.2.0 Magento does not support custom disabling/enabling module output since 2.2.0 version
65+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
66+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
67+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
68+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
69+
* issues that will be addressed in future releases.
4770
* @return boolean
4871
*/
4972
public function isEnabled($moduleName)
@@ -55,7 +78,11 @@ public function isEnabled($moduleName)
5578
* Retrieve module enabled specific path
5679
*
5780
* @param string $path Fully-qualified config path
58-
* @deprecated 100.2.0 Magento does not support custom disabling/enabling module output since 2.2.0 version
81+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
82+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
83+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
84+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
85+
* issues that will be addressed in future releases.
5986
* @return boolean
6087
*/
6188
public function isSetFlag($path)

lib/internal/Magento/Framework/Module/Output/ConfigInterface.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55
*/
66
namespace Magento\Framework\Module\Output;
77

8+
/**
9+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
10+
* version. Module output can still be enabled/disabled in configuration files.
11+
*/
812
interface ConfigInterface
913
{
1014
/**
1115
* Whether a module is enabled in the configuration or not
1216
*
1317
* @param string $moduleName Fully-qualified module name
14-
* @deprecated 100.2.0 Magento does not support custom disabling/enabling module output since 2.2.0 version
18+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
19+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
20+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
21+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
22+
* issues that will be addressed in future releases.
1523
* @return boolean
1624
*/
1725
public function isEnabled($moduleName);
@@ -20,7 +28,11 @@ public function isEnabled($moduleName);
2028
* Retrieve module enabled specific path
2129
*
2230
* @param string $path Fully-qualified config path
23-
* @deprecated 100.2.0 Magento does not support custom disabling/enabling module output since 2.2.0 version
31+
* @deprecated 100.2.0 Magento does not support disabling/enabling modules output from the Admin Panel since 2.2.0
32+
* version. Module output can still be enabled/disabled in configuration files. However, this functionality should
33+
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
34+
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
35+
* issues that will be addressed in future releases.
2436
* @return boolean
2537
*/
2638
public function isSetFlag($path);

0 commit comments

Comments
 (0)