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

PHP8 対応漏れ?「受注管理>受注登録」画面でシステムエラー #829、Warning 回避 #836

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions data/Smarty/templates/admin/order/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -424,17 +424,15 @@
</td>
<!--{assign var=price value="`$arrForm.price.value[$product_index]`"}-->
<!--{assign var=quantity value="`$arrForm.quantity.value[$product_index]`"}-->
<!--{assign var=tax_rate value="`$arrForm.tax_rate.value[$product_index]`"}-->
<!--{assign var=tax_rule value="`$arrForm.tax_rule.value[$product_index]`"}-->
<input type="hidden" name="tax_rule[<!--{$product_index}-->]" value="<!--{$arrForm.tax_rule.value[$product_index]|h}-->" id="tax_rule_<!--{$product_index}-->" />

<td class="right">
<!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|n2s}--> 円<br />
<!--{$arrForm.price_inctax.value[$product_index]|n2s}--> 円<br />
<!--{assign var=key value="tax_rate"}-->
<span class="attention"><!--{$arrErr[$key][$product_index]}--></span>
税率<input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />%
</td>
<td class="right"><!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|sfMultiply:$quantity|n2s}-->円</td>
<td class="right"><!--{$arrForm.price_inctax.value[$product_index]|sfMultiply:$quantity|n2s}-->円</td>
</tr>
<!--{/section}-->
<tr>
Expand Down
16 changes: 12 additions & 4 deletions data/class/SC_FormParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,19 +426,27 @@ public function getKeyList()
// キー名と一致した値を返す
public function getValue($keyname, $default = '')
{
$ret = null;
if (in_array($keyname, $this->keyname)) {
$ret = isset($this->arrValue[$keyname]) ? $this->arrValue[$keyname] : $this->arrDefault[$keyname];
if (!in_array($keyname, $this->keyname)) {
throw new Exception('定義されていない $keyname: ' . var_export($keyname, true));
}

// 意図的に NULL をセットしているケースを考慮し、isset() を使わない。
$ret = array_key_exists($keyname, $this->arrValue) ? $this->arrValue[$keyname] : $this->arrDefault[$keyname];

if (is_array($ret)) {
foreach ($ret as &$value) {
if (SC_Utils_Ex::isBlank($value)) {
// 多次元配列の場合、手出ししない。(PHP8 不具合の応急対応。)
if (is_array($value)) {
// nop
}
elseif (SC_Utils_Ex::isBlank($value)) {
// FIXME: 上で取得している $this->arrDefault を上書きしている。不適切だと思うが影響が大きそうなので対応保留した。
$value = $default;
}
}
} else {
if (SC_Utils_Ex::isBlank($ret)) {
// FIXME: 上で取得している $this->arrDefault を上書きしている。不適切だと思うが影響が大きそうなので対応保留した。
$ret = $default;
}
}
Expand Down
16 changes: 7 additions & 9 deletions data/class/helper/SC_Helper_DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,13 @@ public function sfGetRootId()
public static function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_status)
{
$objQuery = SC_Query_Ex::getSingletonInstance();
$arrRet = $objQuery->select('customer_id', 'dtb_order', 'order_id = ?', array($order_id));
$customer_id = $arrRet[0]['customer_id'];
if ($customer_id != '' && $customer_id >= 1) {
$arrRet = $objQuery->select('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$point = $arrRet[0]['point'];
$rollback_point = $arrRet[0]['point'];

$customer_id = (int) $objQuery->get('customer_id', 'dtb_order', 'order_id = ?', array($order_id));
$rollback_point = 0;
$point = 0;
if ($customer_id >= 1) {
$point = (int) $objQuery->get('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$rollback_point = $point;

// 対応状況がポイント利用対象の場合、使用ポイント分を戻す
if (SC_Helper_Purchase_Ex::isUsePoint($order_status)) {
Expand All @@ -336,9 +337,6 @@ public static function sfGetRollbackPoint($order_id, $use_point, $add_point, $or
if (SC_Helper_Purchase_Ex::isAddPoint($order_status)) {
$rollback_point -= $add_point;
}
} else {
$rollback_point = '';
$point = '';
}

return array($point, $rollback_point);
Expand Down
Loading
Loading