Skip to content

Commit e228d76

Browse files
committed
magento/adobe-stock-integration#1504:Extract logic from controller to a model to enable before plugin interception of parameters - Test failure fixes. Made store_id parameter optional.
1 parent c06a44c commit e228d76

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/OnInsert.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function execute()
5151
return $resultRaw->setContents(
5252
$this->getInsertImageContent->execute(
5353
$data['filename'],
54-
(int)$data['store_id'],
5554
$data['force_static_path'],
56-
$data['as_is']
55+
$data['as_is'],
56+
isset($data['store_id']) ? (int) $data['store_id'] : null
5757
)
5858
);
5959
}

app/code/Magento/Cms/Model/Wysiwyg/Images/GetInsertImageContent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ public function __construct(
4141
* Prepare Image Contents for Insert
4242
*
4343
* @param string $encodedFilename
44-
* @param int $storeId
4544
* @param bool $forceStaticPath
4645
* @param bool $renderAsTag
46+
* @param int|null $storeId
4747
* @return string
4848
*/
4949
public function execute(
5050
string $encodedFilename,
51-
int $storeId,
5251
bool $forceStaticPath,
53-
bool $renderAsTag
52+
bool $renderAsTag,
53+
?int $storeId = null
5454
): string {
5555
$filename = $this->imagesHelper->idDecode($encodedFilename);
5656

0 commit comments

Comments
 (0)