Skip to content

Commit fac2587

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #16495: Fixed spell issue in library (by @sanganinamrata) - #16489: Properly hyphenate "third-party" (by @erikhansen) - #15543: Enhancements to module:status command (by @jissereitsma) - #16472: Improve comment message (by @gelanivishal)
2 parents e1c5225 + b756177 commit fac2587

File tree

6 files changed

+115
-19
lines changed

6 files changed

+115
-19
lines changed

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
417417
<backend_model>Magento\Config\Model\Config\Backend\Store</backend_model>
418418
<comment>
419-
<![CDATA[<strong style="color:red">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).]]>
419+
<![CDATA[<strong style="color:red">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).]]>
420420
</comment>
421421
</field>
422422
<field id="redirect_to_base" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ Web,Web
405405
"Url Options","Url Options"
406406
"Add Store Code to Urls","Add Store Code to Urls"
407407
"
408-
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).
408+
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).
409409
","
410-
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).
410+
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).
411411
"
412412
"Auto-redirect to Base URL","Auto-redirect to Base URL"
413413
"Search Engine Optimization","Search Engine Optimization"
@@ -447,7 +447,7 @@ Tags,Tags
447447
"<h1 class=""page-heading"">404 Error</h1><p>Page not found.</p>","<h1 class=""page-heading"">404 Error</h1><p>Page not found.</p>"
448448
"Community Edition","Community Edition"
449449
"Default Theme","Default Theme"
450-
"If no value is specified, the system default is used. The system default may be modified by third party extensions.","If no value is specified, the system default is used. The system default may be modified by third party extensions."
450+
"If no value is specified, the system default is used. The system default may be modified by third-party extensions.","If no value is specified, the system default is used. The system default may be modified by third-party extensions."
451451
"Applied Theme","Applied Theme"
452452
"Design Rule","Design Rule"
453453
"User Agent Rules","User Agent Rules"

app/code/Magento/Backend/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</settings>
1313
<field name="theme_theme_id" sortOrder="10" formElement="select">
1414
<settings>
15-
<notice translate="true">If no value is specified, the system default is used. The system default may be modified by third party extensions.</notice>
15+
<notice translate="true">If no value is specified, the system default is used. The system default may be modified by third-party extensions.</notice>
1616
<dataType>text</dataType>
1717
<label translate="true">Applied Theme</label>
1818
<dataScope>theme_theme_id</dataScope>

lib/internal/Magento/Framework/Exception/AbstractAggregateException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public function addError(Phrase $phrase)
7878
return $this;
7979
}
8080

81+
/**
82+
* @param LocalizedException $exception
83+
* @return $this
84+
*/
8185
public function addException(LocalizedException $exception)
8286
{
8387
$this->addErrorCalls++;

lib/web/modernizr/modernizr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ window.Modernizr = (function( window, document, undefined ) {
878878

879879
// We first check to see if the type we give it sticks..
880880
// If the type does, we feed it a textual value, which shouldn't be valid.
881-
// If the value doesn't stick, we know there's input sanitization which infers a custom UI
881+
// If the value doesn't stick, we know there's input sanitizationfi which infers a custom UI
882882
if ( bool ) {
883883

884884
inputElem.value = smile;

setup/src/Magento/Setup/Console/Command/ModuleStatusCommand.php

Lines changed: 105 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Setup\Console\Command;
710

11+
use Magento\Framework\Module\FullModuleList;
12+
use Magento\Framework\Module\ModuleList;
813
use Magento\Setup\Model\ObjectManagerProvider;
14+
use Magento\Framework\Console\Cli;
915
use Symfony\Component\Console\Input\InputInterface;
1016
use Symfony\Component\Console\Output\OutputInterface;
17+
use Symfony\Component\Console\Input\InputArgument;
1118

1219
/**
1320
* Command for displaying status of modules
@@ -38,7 +45,10 @@ public function __construct(ObjectManagerProvider $objectManagerProvider)
3845
protected function configure()
3946
{
4047
$this->setName('module:status')
41-
->setDescription('Displays status of modules');
48+
->setDescription('Displays status of modules')
49+
->addArgument('module', InputArgument::OPTIONAL, 'Optional module name')
50+
->addOption('enabled', null, null, 'Print only enabled modules')
51+
->addOption('disabled', null, null, 'Print only disabled modules');
4252
parent::configure();
4353
}
4454

@@ -47,24 +57,106 @@ protected function configure()
4757
*/
4858
protected function execute(InputInterface $input, OutputInterface $output)
4959
{
50-
$moduleList = $this->objectManagerProvider->get()->create(\Magento\Framework\Module\ModuleList::class);
51-
$output->writeln('<info>List of enabled modules:</info>');
52-
$enabledModules = $moduleList->getNames();
53-
if (count($enabledModules) === 0) {
54-
$output->writeln('None');
55-
} else {
56-
$output->writeln(join("\n", $enabledModules));
60+
$moduleName = (string)$input->getArgument('module');
61+
if ($moduleName) {
62+
return $this->showSpecificModule($moduleName, $output);
5763
}
64+
65+
$onlyEnabled = $input->getOption('enabled');
66+
if ($onlyEnabled) {
67+
return $this->showEnabledModules($output);
68+
}
69+
70+
$onlyDisabled = $input->getOption('disabled');
71+
if ($onlyDisabled) {
72+
return $this->showDisabledModules($output);
73+
}
74+
75+
$output->writeln('<info>List of enabled modules:</info>');
76+
$this->showEnabledModules($output);
5877
$output->writeln('');
5978

60-
$fullModuleList = $this->objectManagerProvider->get()->create(\Magento\Framework\Module\FullModuleList::class);
6179
$output->writeln("<info>List of disabled modules:</info>");
62-
$disabledModules = array_diff($fullModuleList->getNames(), $enabledModules);
63-
if (count($disabledModules) === 0) {
80+
$this->showDisabledModules($output);
81+
$output->writeln('');
82+
}
83+
84+
/**
85+
* @param string $moduleName
86+
* @param OutputInterface $output
87+
*/
88+
private function showSpecificModule(string $moduleName, OutputInterface $output)
89+
{
90+
$allModules = $this->getAllModules();
91+
if (!in_array($moduleName, $allModules->getNames())) {
92+
$output->writeln('<error>Module does not exist</error>');
93+
return Cli::RETURN_FAILURE;
94+
}
95+
96+
$enabledModules = $this->getEnabledModules();
97+
if (in_array($moduleName, $enabledModules->getNames())) {
98+
$output->writeln('<info>Module is enabled</info>');
99+
return Cli::RETURN_FAILURE;
100+
}
101+
102+
$output->writeln('<info>Module is disabled</info>');
103+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
104+
}
105+
106+
/**
107+
* @param OutputInterface $output
108+
*/
109+
private function showEnabledModules(OutputInterface $output)
110+
{
111+
$enabledModules = $this->getEnabledModules();
112+
$enabledModuleNames = $enabledModules->getNames();
113+
if (count($enabledModuleNames) === 0) {
114+
$output->writeln('None');
115+
return Cli::RETURN_FAILURE;
116+
}
117+
118+
$output->writeln(join("\n", $enabledModuleNames));
119+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
120+
}
121+
122+
/**
123+
* @param OutputInterface $output
124+
*/
125+
private function showDisabledModules(OutputInterface $output)
126+
{
127+
$disabledModuleNames = $this->getDisabledModuleNames();
128+
if (count($disabledModuleNames) === 0) {
64129
$output->writeln('None');
65-
} else {
66-
$output->writeln(join("\n", $disabledModules));
130+
return Cli::RETURN_FAILURE;
67131
}
132+
133+
$output->writeln(join("\n", $disabledModuleNames));
68134
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
69135
}
136+
137+
/**
138+
* @return FullModuleList
139+
*/
140+
private function getAllModules(): FullModuleList
141+
{
142+
return $this->objectManagerProvider->get()->create(FullModuleList::class);
143+
}
144+
145+
/**
146+
* @return ModuleList
147+
*/
148+
private function getEnabledModules(): ModuleList
149+
{
150+
return $this->objectManagerProvider->get()->create(ModuleList::class);
151+
}
152+
153+
/**
154+
* @return array
155+
*/
156+
private function getDisabledModuleNames(): array
157+
{
158+
$fullModuleList = $this->getAllModules();
159+
$enabledModules = $this->getEnabledModules();
160+
return array_diff($fullModuleList->getNames(), $enabledModules->getNames());
161+
}
70162
}

0 commit comments

Comments
 (0)