Skip to content

Commit

Permalink
Merge pull request #416 from magento-folks/2.0.11_bugs_pr
Browse files Browse the repository at this point in the history
[Folks] 2.0.11 bugs
- MAGETWO-56955 [Backport] - Validation message displayed all the time - for 2.0
- MAGETWO-57681 [GITHUB] Customer cannot reorder if the order has been invoiced or shipped #6278
  • Loading branch information
slavvka authored Sep 22, 2016
2 parents 11abd08 + 3d5fdc9 commit 7af4e4b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected function _afterLoad()
* Assign parent items
*/
foreach ($this as $item) {
$this->_resource->unserializeFields($item);
if ($item->getParentItemId()) {
$item->setParentItem($this->getItemById($item->getParentItemId()));
}
Expand Down
19 changes: 16 additions & 3 deletions app/code/Magento/Theme/view/frontend/web/js/view/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,35 @@
define([
'jquery',
'uiComponent',
'underscore',
'Magento_Customer/js/customer-data',
'jquery/jquery-storageapi'
], function ($, Component, customerData) {
], function ($, Component, _, customerData) {
'use strict';

return Component.extend({
defaults: {
cookieMessages: [],
messages: []
},

/** @inheritdoc */
initialize: function () {
this._super();

this.cookieMessages = $.cookieStorage.get('mage-messages');
this.messages = customerData.get('messages').extend({disposableCustomerData: 'messages'});
$.cookieStorage.setConf({path: '/', expires: -1}).set('mage-messages', null);
this.messages = customerData.get('messages').extend({
disposableCustomerData: 'messages'
});

if (!_.isEmpty(this.messages().messages)) {
customerData.set('messages', {});
}

$.cookieStorage.setConf({
path: '/',
expires: -1
}).set('mage-messages', null);
}
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Sales\Model\ResourceModel;

class OrderItemTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \Magento\Framework\ObjectManagerInterface
*/
private $objectManager;

protected function setUp()
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}

/**
* Verify that serialized order item data was unserialized after load
*
* @magentoDataFixture Magento/Catalog/_files/order_item_with_product_and_custom_options.php
*/
public function testGetOrderItem()
{
/** @var \Magento\Sales\Model\Order $order */
$order = $this->objectManager->create(\Magento\Sales\Model\Order::class);
$order->loadByIncrementId('100000001');
$items = $order->getItemsCollection();
$this->assertNotEquals(0, $items->getSize());
foreach ($items as $item) {
$info = $item->getDataByKey('product_options');
$this->assertTrue(is_array($info));
}
}
}

0 comments on commit 7af4e4b

Please sign in to comment.