Skip to content

Commit 3fc2303

Browse files
Revert "Media Gallery configuration are reversed"
This reverts commit 3633542.
1 parent 8b592ee commit 3fc2303

File tree

11 files changed

+18
-32
lines changed

11 files changed

+18
-32
lines changed

app/code/Magento/MediaGalleryCatalogIntegration/Plugin/SaveBaseCategoryImageInformation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct(
8686
*/
8787
public function afterMoveFileFromTmp(ImageUploader $subject, string $imagePath): string
8888
{
89-
if ($this->config->isEnabled()) {
89+
if (!$this->config->isEnabled()) {
9090
return $imagePath;
9191
}
9292

app/code/Magento/MediaGalleryIntegration/Model/OpenDialogUrlProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public function __construct(ConfigInterface $config)
3535
*/
3636
public function getUrl(): string
3737
{
38-
return $this->config->isEnabled() ? 'cms/wysiwyg_images/index' : 'media_gallery/index/index';
38+
return $this->config->isEnabled() ? 'media_gallery/index/index' : 'cms/wysiwyg_images/index';
3939
}
4040
}

app/code/Magento/MediaGalleryIntegration/Plugin/SaveImageInformation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct(
7878
*/
7979
public function afterSave(Uploader $subject, array $result): array
8080
{
81-
if ($this->config->isEnabled()) {
81+
if (!$this->config->isEnabled()) {
8282
return $result;
8383
}
8484

app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/ImageComponentOpenDialogUrlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function setUp(): void
5050

5151
/**
5252
* Test image open dialog url when enhanced media gallery not enabled.
53-
* @magentoConfigFixture default/system/media_gallery/enabled 1
53+
* @magentoConfigFixture default/system/media_gallery/enabled 0
5454
*/
5555
public function testWithEnhancedMediaGalleryDisabled(): void
5656
{
@@ -61,7 +61,7 @@ public function testWithEnhancedMediaGalleryDisabled(): void
6161

6262
/**
6363
* Test image open dialog url when enhanced media gallery enabled.
64-
* @magentoConfigFixture default/system/media_gallery/enabled 0
64+
* @magentoConfigFixture default/system/media_gallery/enabled 1
6565
*/
6666
public function testWithEnhancedMediaGalleryEnabled(): void
6767
{

app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/OpenDialogUrlProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp(): void
4545

4646
/**
4747
* Test getting open dialog url with enhanced media gallery disabled.
48-
* @magentoConfigFixture default/system/media_gallery/enabled 1
48+
* @magentoConfigFixture default/system/media_gallery/enabled 0
4949
*/
5050
public function testWithEnhancedMediaGalleryDisabled(): void
5151
{
@@ -54,7 +54,7 @@ public function testWithEnhancedMediaGalleryDisabled(): void
5454

5555
/**
5656
* Test getting open dialog url when enhanced media gallery enabled.
57-
* @magentoConfigFixture default/system/media_gallery/enabled 0
57+
* @magentoConfigFixture default/system/media_gallery/enabled 1
5858
*/
5959
public function testWithEnhancedMediaGalleryEnabled(): void
6060
{

app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/TinyMceOpenDialogUrlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function setUp(): void
5858

5959
/**
6060
* Test image open dialog url when enhanced media gallery not enabled.
61-
* @magentoConfigFixture default/system/media_gallery/enabled 1
61+
* @magentoConfigFixture default/system/media_gallery/enabled 0
6262
*/
6363
public function testWithEnhancedMediaGalleryDisabled(): void
6464
{
@@ -68,7 +68,7 @@ public function testWithEnhancedMediaGalleryDisabled(): void
6868

6969
/**
7070
* Test image open dialog url when enhanced media gallery enabled.
71-
* @magentoConfigFixture default/system/media_gallery/enabled 0
71+
* @magentoConfigFixture default/system/media_gallery/enabled 1
7272
*/
7373
public function testWithEnhancedMediaGalleryEnabled(): void
7474
{

app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/WysiwygDefaultConfigOpenDialogUrlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function setUp(): void
5858

5959
/**
6060
* Test update wysiwyg editor open dialog url when enhanced media gallery not enabled.
61-
* @magentoConfigFixture default/system/media_gallery/enabled 1
61+
* @magentoConfigFixture default/system/media_gallery/enabled 0
6262
*/
6363
public function testWithEnhancedMediaGalleryDisabled(): void
6464
{
@@ -70,7 +70,7 @@ public function testWithEnhancedMediaGalleryDisabled(): void
7070

7171
/**
7272
* Test update wysiwyg editor open dialog url when enhanced media gallery enabled.
73-
* @magentoConfigFixture default/system/media_gallery/enabled 0
73+
* @magentoConfigFixture default/system/media_gallery/enabled 1
7474
*/
7575
public function testWithEnhancedMediaGalleryEnabled(): void
7676
{

app/code/Magento/MediaGallerySynchronization/Plugin/MediaGallerySyncTrigger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function afterSave(Value $config, Value $result): Value
4343
{
4444
if ($result->getPath() === self::MEDIA_GALLERY_CONFIG_VALUE
4545
&& $result->isValueChanged()
46-
&& (int) $result->getValue() !== self::MEDIA_GALLERY_ENABLED_VALUE
46+
&& (int) $result->getValue() === self::MEDIA_GALLERY_ENABLED_VALUE
4747
) {
4848
$this->publish->execute();
4949
}

app/code/Magento/MediaGalleryUi/Test/Mftf/Data/AdobeStockConfigData.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1010
<entity name="MediaGalleryConfigDataEnabled">
1111
<data key="path">system/media_gallery/enabled</data>
12-
<data key="value">0</data>
12+
<data key="value">1</data>
1313
</entity>
1414
<entity name="MediaGalleryConfigDataDisabled">
1515
<data key="path">system/media_gallery/enabled</data>
16-
<data key="value">1</data>
16+
<data key="value">0</data>
1717
</entity>
1818
</entities>

app/code/Magento/MediaGalleryUi/etc/adminhtml/menu.xml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
99
<menu>
10-
<add id="Magento_MediaGalleryUi::media"
11-
title="Media"
12-
translate="title"
13-
module="Magento_MediaGalleryUi"
14-
sortOrder="15"
15-
parent="Magento_Backend::content"
16-
resource="Magento_Cms::media_gallery"
17-
dependsOnConfig="system/media_gallery/enabled"/>
18-
<add id="Magento_MediaGalleryUi::media_gallery"
19-
title="Media Gallery"
20-
translate="title"
21-
module="Magento_MediaGalleryUi"
22-
sortOrder="0"
23-
parent="Magento_MediaGalleryUi::media"
24-
action="media_gallery/media/index"
25-
resource="Magento_Cms::media_gallery"/>
10+
<add id="Magento_MediaGalleryUi::media" title="Media" translate="title" module="Magento_MediaGalleryUi" sortOrder="15" parent="Magento_Backend::content" resource="Magento_Cms::media_gallery" dependsOnConfig="system/media_gallery/enabled"/>
11+
<add id="Magento_MediaGalleryUi::media_gallery" title="Media Gallery" translate="title" module="Magento_MediaGalleryUi" sortOrder="0" parent="Magento_MediaGalleryUi::media" action="media_gallery/media/index" resource="Magento_Cms::media_gallery"/>
2612
</menu>
2713
</config>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<system>
1010
<section id="system">
1111
<group id="media_gallery" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="0" showInStore="0">
12-
<label>Media Gallery</label>
12+
<label>Enhanced Media Gallery</label>
1313
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
14-
<label>Enable Old Media Gallery</label>
14+
<label>Enabled</label>
1515
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1616
<config_path>system/media_gallery/enabled</config_path>
1717
</field>

0 commit comments

Comments
 (0)