Skip to content

Commit

Permalink
Merge pull request #689 from modx-pro/3.0.3
Browse files Browse the repository at this point in the history
3.0.3
  • Loading branch information
biz87 committed May 30, 2022
2 parents 90defab + 827bdc5 commit 65ef7d8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion _build/build.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const PKG_NAME = 'miniShop2';
define('PKG_NAME_LOWER', strtolower(PKG_NAME));

const PKG_VERSION = '3.0.2';
const PKG_VERSION = '3.0.3';
const PKG_RELEASE = 'pl';
const PKG_AUTO_INSTALL = true;

Expand Down
7 changes: 7 additions & 0 deletions core/components/minishop2/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.3-pl] - 2022-05-30

### Changed
- Fixed error with escaping of the rank on object msOrderStatus
- Added escaping of the rank in upload processor
- Returned the ability to add any fields to the order object

## [3.0.2-pl] - 2022-05-20

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ public function getForSubmit($data)
$createdon = date('Y-m-d H:i:s');
/** @var msOrder $msOrder */
$msOrder = $this->modx->newObject('msOrder');
$msOrder->fromArray(array(
'user_id' => $data['user_id'],

$orderData = array_merge($order, $data, [
'createdon' => $createdon,
'num' => $data['num'],
'delivery' => $order['delivery'],
'payment' => $order['payment'],
'cart_cost' => $data['cart_cost'],
'weight' => $data['cart_status']['total_weight'],
'delivery_cost' => $data['delivery_cost'],
'cost' => $data['cart_cost'] + $data['delivery_cost'],
'status' => 0,
'context' => $this->ctx,
));
]);
$msOrder->fromArray($orderData);

// Adding address
/** @var msOrderAddress $address */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ public function changeOrderStatus($order_id, $status_id)
$error = 'ms2_err_status_final';
} else {
if ($old_status->get('fixed')) {
if ($status->get($this->modx->escape('rank')) <= $old_status->get($this->modx->escape('rank'))) {
if ($status->get('rank') <= $old_status->get('rank')) {
$error = 'ms2_err_status_fixed';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function process()

if (empty($rank)) {
$imagesTable = $this->modx->getTableName($this->classKey);
$sql = "UPDATE {$imagesTable} SET rank = rank + 1 WHERE product_id ='" . $this->product->id . "' AND id !='" . $uploaded_file->get('id') . "'";
$sql = "UPDATE {$imagesTable} SET `rank` = `rank` + 1 WHERE product_id ='" . $this->product->id . "' AND id !='" . $uploaded_file->get('id') . "'";
$this->modx->exec($sql);
}

Expand Down

0 comments on commit 65ef7d8

Please sign in to comment.