Skip to content
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

SC_Helper_Purchase:: getOrderTemp()の返り値を必ずarrayに #1070

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

clicktx
Copy link
Contributor

@clicktx clicktx commented Nov 28, 2024

data/class/helper/SC_Helper_Purchase.php

2024/11/xx 13:04:38 [/shopping/confirm.php] Warning(E_WARNING): array_merge(): Expected parameter 1 to be an array, null given on [/path/data/class/pages/shopping/LC_Page_Shopping_Confirm.php(145)] from xxx.xxx.xxx.xxx

// 一時受注テーブルの読込
$arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
// カート集計を元に最終計算
$arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer,
$arrOrderTemp['use_point'],
$objPurchase->getShippingPref($this->is_multiple),
$arrOrderTemp['charge'],
$arrOrderTemp['discount'],
$arrOrderTemp['deliv_id'],
$arrOrderTemp['order_pref'], // 税金計算の為に追加 注文者基準
$arrOrderTemp['order_country_id'] // 税金計算の為に追加 注文者基準
);
$this->arrForm = array_merge($arrOrderTemp, $arrCalcResults);

array_merge()で警告が出る時がある。
恐らく、注文完了後のブラウザバック等の時(未検証)

SC_Query::getRow()の返り値がnullなのが問題の原点ですが。

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.71%. Comparing base (b083b10) to head (0b9d2f3).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1070   +/-   ##
=======================================
  Coverage   51.70%   51.71%           
=======================================
  Files          80       80           
  Lines       10217    10218    +1     
=======================================
+ Hits         5283     5284    +1     
  Misses       4934     4934           
Flag Coverage Δ
tests 51.71% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nanasess nanasess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正方針は問題ございません。

SC_Helper_Purchase_getOrderTempTest::testGetOrderTemp存在しない受注IDを指定した場合結果が空になる() の結果が null を想定しているようですので、こちらも空の array に修正お願いできますでしょうか。

data/class/helper/SC_Helper_Purchase.php Outdated Show resolved Hide resolved
@nanasess nanasess added this to the 2.18(仮) milestone Dec 16, 2024
@nanasess nanasess enabled auto-merge December 20, 2024 07:20
Copy link
Contributor

@nanasess nanasess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanasess nanasess merged commit 0ac0b1d into EC-CUBE:master Dec 20, 2024
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants