Skip to content

Commit

Permalink
Merge pull request EC-CUBE#1070 from clicktx/fix/return-value-not-array
Browse files Browse the repository at this point in the history
SC_Helper_Purchase:: getOrderTemp()の返り値を必ずarrayに
  • Loading branch information
nanasess authored Dec 20, 2024
2 parents b083b10 + 0b9d2f3 commit 0ac0b1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion data/class/helper/SC_Helper_Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ public static function getOrderTemp($uniqId)
{
$objQuery = SC_Query_Ex::getSingletonInstance();

return $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', [$uniqId]);
$result = $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', [$uniqId]);
return is_array($result) ? $result : []; // 必ず配列を返す
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGetOrderTemp存在しない受注IDを指定した場合結
{
$order_id = '9999';

$this->expected = null;
$this->expected = [];
$this->actual = SC_Helper_Purchase::getOrderTemp($order_id);

$this->verify();
Expand Down

0 comments on commit 0ac0b1d

Please sign in to comment.