forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
magento/adobe-stock-integration#1712: Remove DataObject usage from Op…
…enDialogUrl provider - remove data object usage from OpenDialogUrl provider, added new plugin and modified the integration test
- Loading branch information
joweecaquicla
committed
Aug 12, 2020
1 parent
be26941
commit 68b35c5
Showing
4 changed files
with
54 additions
and
23 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
app/code/Magento/MediaGalleryIntegration/Plugin/NewMediaGalleryOpenDialogUrl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\MediaGalleryIntegration\Plugin; | ||
|
||
use Magento\MediaGalleryUiApi\Api\ConfigInterface; | ||
use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl; | ||
|
||
class NewMediaGalleryOpenDialogUrl | ||
{ | ||
/** | ||
* @var ConfigInterface | ||
*/ | ||
private $config; | ||
|
||
/** | ||
* @param ConfigInterface $config | ||
*/ | ||
public function __construct(ConfigInterface $config) | ||
{ | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @param OpenDialogUrl $subject | ||
* @param string $result | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
* @return string | ||
*/ | ||
public function afterGet(OpenDialogUrl $subject, string $result) | ||
{ | ||
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/newmediagalleryplugin.log'); | ||
$logger = new \Zend\Log\Logger(); | ||
$logger->addWriter($writer); | ||
$logger->debug(__METHOD__); | ||
$logger->debug("PASSING HERE!"); | ||
return $this->config->isEnabled() ? 'media_gallery/index/index' : $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters