Skip to content

35937 internal server error in /v1/carts/mine/items api endpoint #37866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 2.4-develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions app/code/Magento/Webapi/Controller/Rest/ParamsOverrider.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ protected function isNestedArrayValueSet($nestedArray, $arrayKeys)
{
//Converting input data to camelCase in order to process both snake and camel style data equally.
$currentArray = $this->dataObjectConverter->convertKeysToCamelCase($nestedArray);

foreach ($arrayKeys as $key) {
$key = SimpleDataObjectConverter::snakeCaseToCamelCase($key);
if (!isset($currentArray[$key])) {
Expand All @@ -96,9 +95,9 @@ protected function isNestedArrayValueSet($nestedArray, $arrayKeys)
/**
* Set a nested array value.
*
* @param array &$nestedArray
* @param array &$nestedArray
* @param string[] $arrayKeys
* @param string $valueToSet
* @param string $valueToSet
* @return void
*/
protected function setNestedArrayValue(&$nestedArray, $arrayKeys, $valueToSet)
Expand All @@ -116,14 +115,13 @@ protected function setNestedArrayValue(&$nestedArray, $arrayKeys, $valueToSet)
}
$currentArray = &$currentArray[$key];
}

//In case input data uses camelCase format
$camelCaseKey = SimpleDataObjectConverter::snakeCaseToCamelCase($lastKey);
if (array_key_exists($camelCaseKey, $currentArray)) {
$lastKey = $camelCaseKey;
if (is_array($currentArray)) {
if (array_key_exists($camelCaseKey, $currentArray)) {
$lastKey = $camelCaseKey;
}
$currentArray[$lastKey] = $valueToSet;
}

$currentArray[$lastKey] = $valueToSet;
}

/**
Expand Down Expand Up @@ -237,6 +235,7 @@ private function isPropertyDeclaredInDataObject(
* @return \Magento\Framework\Reflection\MethodsMap
*
* @deprecated 100.1.0
* @see Nothing
*/
private function getMethodsMap()
{
Expand Down