Skip to content

Commit 91b74f0

Browse files
committed
AC-15893: Admin Order Creation: Session Size Overflow When Adding 20+ Products (Session size exceeded 256KB limit)
Static test failure fix
1 parent 8f38468 commit 91b74f0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/code/Magento/Sales/Controller/Adminhtml/Order/Create/ShowUpdateResult.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public function execute()
6262
if (is_array($updateResult) && isset($updateResult['compressed']) && $updateResult['compressed']) {
6363
if (isset($updateResult['data']) && function_exists('gzdecode')) {
6464
// phpcs:ignore Magento2.Functions.DiscouragedFunction
65-
$resultRaw->setContents(@gzdecode($updateResult['data']) ?: '');
65+
$decompressed = gzdecode($updateResult['data']);
66+
// gzdecode returns false on error, handle gracefully
67+
$resultRaw->setContents(is_string($decompressed) ? $decompressed : '');
6668
} else {
6769
$resultRaw->setContents('');
6870
}

app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ShowUpdateResultTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class ShowUpdateResultTest extends TestCase
7272

7373
/**
7474
* @inheritdoc
75+
*
76+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
7577
*/
7678
protected function setUp(): void
7779
{

0 commit comments

Comments
 (0)