Skip to content

Commit

Permalink
Some fixes for MySql STRICT_TRANS_TABLES mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bezumkin committed Aug 25, 2013
1 parent c0e885b commit 4f6a1dd
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var methods = {
}]
},{
html: MODx.onDocFormRender, border: false
},{xtype: 'hidden',name: 'id',id: 'modx-resource-id',value: config.resource || config.record.id,submitValue: true}
},{xtype: 'hidden',name: 'id', id: 'modx-resource-id',value: config.record.id, submitValue: true}
,{xtype: 'hidden',name: 'type',value: 'document'}
,{xtype: 'hidden',name: 'context_key',id: 'modx-resource-context-key',value: config.record.context_key || 'web'}
,{xtype: 'hidden',name: 'content_type',id: 'modx-resource-content-type', value: MODx.config.default_content_type || 1}
Expand Down
6 changes: 5 additions & 1 deletion assets/components/minishop2/js/mgr/settings/delivery.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ Ext.extend(miniShop2.grid.Delivery,MODx.grid.Grid,{
}
});
//}
this.windows.createDelivery.fp.getForm().reset();
this.windows.createDelivery.fp.getForm().reset().setValues({
price: 0
,weight_price: 0
,distance_price: 0
});
this.windows.createDelivery.show(e.target);
}
,updateDelivery: function(btn,e) {
Expand Down
12 changes: 7 additions & 5 deletions core/components/minishop2/controllers/product/update.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,14 @@ function loadPlugins() {
* @return array
*/
function getSourceProperties() {
/* @var $source modMediaSource */
$source = $this->resource->initializeMediaSource();
$tmp = $source->getProperties();
$properties = array();
foreach ($tmp as $v) {
$properties[$v['name']] = $v['value'];
/* @var $source modMediaSource */
if ($source = $this->resource->initializeMediaSource()) {
$tmp = $source->getProperties();
$properties = array();
foreach ($tmp as $v) {
$properties[$v['name']] = $v['value'];
}
}

return $properties;
Expand Down
1 change: 1 addition & 0 deletions core/components/minishop2/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog for miniShop2.
- [#58] Fixed PayPal non-USD currency.
- [#56] Added JSON field "properties" to "msProductFile".
- [#50] Fixed checking of the existence of the Tickets component.
- Some fixes for MySql STRICT_TRANS_TABLES mode.

2.0.1 pl3
==============
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function toArray($keyPrefix= '', $rawValues= false, $excludeLazy= false,
$array = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);

if (!is_object($this->data)) {$this->loadData();}
return array_merge($array, $this->data->toArray());
return array_merge($this->data->toArray(), $array);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
'precision' => '10',
'phptype' => 'integer',
'attributes' => 'unsigned',
'null' => false,
'index' => 'pk',
),
'account' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'createdon' =>
Expand All @@ -43,7 +44,7 @@
'precision' => '10',
'phptype' => 'integer',
'attributes' => 'unsigned',
'null' => false,
'null' => true,
'default' => 0,
'index' => 'index',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'weight_price' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'distance_price' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'logo' =>
Expand All @@ -70,15 +70,15 @@
'precision' => '1',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'active' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 1,
),
'class' =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'user_id' => NULL,
'createdon' => '0000-00-00 00:00:00',
'updatedon' => '0000-00-00 00:00:00',
'num' => NULL,
'num' => '',
'cost' => 0,
'cart_cost' => 0,
'delivery_cost' => 0,
Expand Down Expand Up @@ -52,37 +52,38 @@
'precision' => '20',
'phptype' => 'string',
'null' => true,
'default' => '',
),
'cost' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'cart_cost' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'delivery_cost' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'weight' =>
array (
'dbtype' => 'decimal',
'precision' => '13,3',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'status' =>
Expand All @@ -91,7 +92,7 @@
'precision' => '10',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'delivery' =>
Expand All @@ -100,7 +101,7 @@
'precision' => '10',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'payment' =>
Expand All @@ -109,7 +110,7 @@
'precision' => '10',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'address' =>
Expand All @@ -118,14 +119,15 @@
'precision' => '10',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => true,
'default' => 0,
),
'context' =>
array (
'dbtype' => 'varchar',
'precision' => '100',
'phptype' => 'string',
'null' => false,
'null' => true,
'default' => 'web',
),
'comment' =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@
'precision' => '10',
'phptype' => 'integer',
'attributes' => 'unsigned',
'null' => false,
'null' => true,
'default' => 1,
),
'price' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'weight' =>
array (
'dbtype' => 'decimal',
'precision' => '13,3',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'cost' =>
array (
'dbtype' => 'decimal',
'precision' => '12,2',
'phptype' => 'float',
'null' => false,
'null' => true,
'default' => 0,
),
'options' =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
'color' => '000000',
'email_user' => 0,
'email_manager' => 0,
'subject_user' => NULL,
'subject_manager' => NULL,
'subject_user' => '',
'subject_manager' => '',
'body_user' => 0,
'body_manager' => 0,
'active' => 1,
Expand Down Expand Up @@ -41,38 +41,40 @@
'dbtype' => 'char',
'precision' => '6',
'phptype' => 'string',
'null' => false,
'null' => true,
'default' => '000000',
),
'email_user' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'email_manager' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'subject_user' =>
array (
'dbtype' => 'varchar',
'precision' => '255',
'phptype' => 'string',
'null' => false,
'null' => true,
'default' => '',
),
'subject_manager' =>
array (
'dbtype' => 'varchar',
'precision' => '255',
'phptype' => 'string',
'null' => false,
'null' => true,
'default' => '',
),
'body_user' =>
array (
Expand All @@ -95,23 +97,23 @@
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 1,
),
'final' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'fixed' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'rank' =>
Expand All @@ -120,15 +122,15 @@
'precision' => '1',
'phptype' => 'integer',
'attributes' => 'unsigned',
'null' => false,
'null' => true,
'default' => 0,
),
'editable' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 1,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'precision' => '1',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 0,
),
'active' =>
Expand All @@ -51,7 +51,7 @@
'precision' => '1',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'null' => true,
'default' => 1,
),
'class' =>
Expand Down
Loading

0 comments on commit 4f6a1dd

Please sign in to comment.