-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5879 from magento-tsg-csl3/2.4-develop-pr34
[TSG-CSL3] For 2.4|2.4 (pr34)
- Loading branch information
Showing
44 changed files
with
1,786 additions
and
559 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
app/code/Magento/Catalog/Api/ProductAttributeOptionUpdateInterface.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,33 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Api; | ||
|
||
/** | ||
* Interface to update product attribute option | ||
* | ||
* @api | ||
*/ | ||
interface ProductAttributeOptionUpdateInterface | ||
{ | ||
/** | ||
* Update attribute option | ||
* | ||
* @param string $attributeCode | ||
* @param int $optionId | ||
* @param \Magento\Eav\Api\Data\AttributeOptionInterface $option | ||
* @return bool | ||
* @throws \Magento\Framework\Exception\StateException | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\InputException | ||
*/ | ||
public function update( | ||
string $attributeCode, | ||
int $optionId, | ||
\Magento\Eav\Api\Data\AttributeOptionInterface $option | ||
): bool; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,9 @@ | |
/** | ||
* Catalog product option file type | ||
* | ||
* @author Magento Core Team <[email protected]> | ||
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity) | ||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) | ||
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse) | ||
*/ | ||
class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType | ||
{ | ||
|
@@ -181,6 +182,7 @@ protected function _getProcessingParams() | |
|
||
/** | ||
* Returns file info array if we need to get file from already existing file. | ||
* | ||
* Or returns null, if we need to get file from uploaded array. | ||
* | ||
* @return null|array | ||
|
@@ -262,7 +264,6 @@ public function validateUserValue($values) | |
. "Make sure the options are entered and try again." | ||
) | ||
); | ||
break; | ||
default: | ||
$this->setUserValue(null); | ||
break; | ||
|
@@ -330,7 +331,11 @@ public function prepareForCart() | |
public function getFormattedOptionValue($optionValue) | ||
{ | ||
if ($this->_formattedOptionValue === null) { | ||
$value = $this->serializer->unserialize($optionValue); | ||
try { | ||
$value = $this->serializer->unserialize($optionValue); | ||
} catch (\InvalidArgumentException $e) { | ||
return $optionValue; | ||
} | ||
if ($value === null) { | ||
return $optionValue; | ||
} | ||
|
@@ -476,13 +481,13 @@ public function copyQuoteToOrder() | |
try { | ||
$value = $this->serializer->unserialize($quoteOption->getValue()); | ||
if (!isset($value['quote_path'])) { | ||
throw new \Exception(); | ||
return $this; | ||
} | ||
$quotePath = $value['quote_path']; | ||
$orderPath = $value['order_path']; | ||
|
||
if (!$this->mediaDirectory->isFile($quotePath) || !$this->mediaDirectory->isReadable($quotePath)) { | ||
throw new \Exception(); | ||
return $this; | ||
} | ||
|
||
if ($this->_coreFileStorageDatabase->checkDbUsage()) { | ||
|
@@ -524,6 +529,8 @@ protected function _getOptionDownloadUrl($route, $params) | |
} | ||
|
||
/** | ||
* Prepare size | ||
* | ||
* @param array $value | ||
* @return string | ||
*/ | ||
|
Oops, something went wrong.