Skip to content

Commit ae94a5a

Browse files
committed
MC-40729: Disable Web Setup wizard
- Restored files causing major version increase
1 parent 598e134 commit ae94a5a

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Model\Setup;
7+
8+
use Magento\Backend\Model\Menu;
9+
use Magento\Backend\Model\Menu\Builder;
10+
use Magento\Framework\App\DocRootLocator;
11+
12+
/**
13+
* Plugin class to remove web setup wizard from menu if application root is pub/ and no setup url variable is specified.
14+
* @api
15+
* @since 100.1.0
16+
* @deprecated Starting from Magento 2.3.6 Web Setup Wizard is deprecated
17+
*/
18+
class MenuBuilder
19+
{
20+
/**
21+
* @var DocRootLocator
22+
* @since 100.1.0
23+
*/
24+
protected $docRootLocator;
25+
26+
/**
27+
* MenuBuilder constructor.
28+
*
29+
* @param DocRootLocator $docRootLocator
30+
*/
31+
public function __construct(DocRootLocator $docRootLocator)
32+
{
33+
$this->docRootLocator = $docRootLocator;
34+
}
35+
36+
/**
37+
* Removes 'Web Setup Wizard' from the menu if doc root is pub and no setup url variable is specified.
38+
*
39+
* @param Builder $subject
40+
* @param Menu $menu
41+
* @return Menu
42+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
43+
* @since 100.1.0
44+
*/
45+
public function afterGetResult(Builder $subject, Menu $menu)
46+
{
47+
if ($this->docRootLocator->isPub()) {
48+
$menu->remove('Magento_Backend::setup_wizard');
49+
}
50+
return $menu;
51+
}
52+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@
137137
<argument name="isIncludesAvailable" xsi:type="boolean">false</argument>
138138
</arguments>
139139
</type>
140+
<type name="Magento\Backend\Model\Menu\Builder">
141+
<plugin name="SetupMenuBuilder" type="Magento\Backend\Model\Setup\MenuBuilder" />
142+
</type>
140143
<type name="Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProduction">
141144
<arguments>
142145
<argument name="configs" xsi:type="array">

0 commit comments

Comments
 (0)