Skip to content

Commit 2a22a46

Browse files
author
olysenko
committed
Merge remote-tracking branch 'origin/develop' into MAGETWO-63716
2 parents 1819964 + 061977e commit 2a22a46

File tree

15 files changed

+139
-69
lines changed

15 files changed

+139
-69
lines changed

app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,33 @@ class VaultDetailsHandler implements HandlerInterface
4141
*/
4242
protected $config;
4343

44+
/**
45+
* @var \Magento\Framework\Serialize\SerializerInterface
46+
*/
47+
private $serializer;
48+
4449
/**
4550
* Constructor
4651
*
4752
* @param PaymentTokenInterfaceFactory $paymentTokenFactory
4853
* @param OrderPaymentExtensionInterfaceFactory $paymentExtensionFactory
4954
* @param Config $config
5055
* @param SubjectReader $subjectReader
56+
* @param \Magento\Framework\Serialize\SerializerInterface $serializer
5157
*/
5258
public function __construct(
5359
PaymentTokenInterfaceFactory $paymentTokenFactory,
5460
OrderPaymentExtensionInterfaceFactory $paymentExtensionFactory,
5561
Config $config,
56-
SubjectReader $subjectReader
62+
SubjectReader $subjectReader,
63+
\Magento\Framework\Serialize\SerializerInterface $serializer = null
5764
) {
5865
$this->paymentTokenFactory = $paymentTokenFactory;
5966
$this->paymentExtensionFactory = $paymentExtensionFactory;
6067
$this->config = $config;
6168
$this->subjectReader = $subjectReader;
69+
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
70+
->get(\Magento\Framework\Serialize\SerializerInterface::class);
6271
}
6372

6473
/**
@@ -133,7 +142,7 @@ private function getExpirationDate(Transaction $transaction)
133142
*/
134143
private function convertDetailsToJSON($details)
135144
{
136-
$json = \Zend_Json::encode($details);
145+
$json = $this->serializer->serialize($details);
137146
return $json ? $json : '{}';
138147
}
139148

app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,20 @@ protected function setUp()
122122
->method('getCctypesMapper')
123123
->willReturn($mapperArray);
124124

125+
$this->serializer = $this->getMock(
126+
\Magento\Framework\Serialize\SerializerInterface::class,
127+
[],
128+
[],
129+
'',
130+
false
131+
);
132+
125133
$this->paymentHandler = new VaultDetailsHandler(
126134
$this->paymentTokenFactory,
127135
$this->paymentExtensionFactory,
128136
$this->config,
129-
$this->subjectReader
137+
$this->subjectReader,
138+
$this->serializer
130139
);
131140
}
132141

app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceBlock name="shipment_items">
11-
<block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/shipment/view/items/renderer.phtml"/>
11+
<block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" name="shipment_item_bundle" as="shipment_item_bundle" template="sales/shipment/view/items/renderer.phtml"/>
1212
</referenceBlock>
1313
</body>
1414
</page>

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ protected function collectRawData()
961961

962962
if ($storeId != Store::DEFAULT_STORE_ID
963963
&& isset($data[$itemId][Store::DEFAULT_STORE_ID][$fieldName])
964-
&& $data[$itemId][Store::DEFAULT_STORE_ID][$fieldName] == $attrValue
964+
&& $data[$itemId][Store::DEFAULT_STORE_ID][$fieldName] == htmlspecialchars_decode($attrValue)
965965
) {
966966
continue;
967967
}
@@ -1000,7 +1000,7 @@ protected function collectRawData()
10001000
$data[$itemId][$storeId][self::COL_ATTR_SET] = $this->_attrSetIdToName[$attrSetId];
10011001
$data[$itemId][$storeId][self::COL_TYPE] = $item->getTypeId();
10021002
}
1003-
$data[$itemId][$storeId][self::COL_SKU] = $item->getSku();
1003+
$data[$itemId][$storeId][self::COL_SKU] = htmlspecialchars_decode($item->getSku());
10041004
$data[$itemId][$storeId]['store_id'] = $storeId;
10051005
$data[$itemId][$storeId]['product_id'] = $itemId;
10061006
$data[$itemId][$storeId]['product_link_id'] = $productLinkId;

app/code/Magento/Customer/etc/frontend/sections.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<action name="customer/account/logout"/>
1111
<action name="customer/account/loginPost"/>
1212
<action name="customer/account/createPost"/>
13+
<action name="customer/account/editPost"/>
1314
<action name="customer/ajax/login">
1415
<section name="checkout-data"/>
1516
<section name="cart"/>

app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<block class="Magento\Sales\Block\Adminhtml\Order\View\Info" name="order_info" template="Magento_Sales::order/view/info.phtml"/>
1515
<block class="Magento\Sales\Block\Adminhtml\Order\Payment" name="order_payment"/>
1616
<block class="Magento\Shipping\Block\Adminhtml\Create\Items" name="order_items" template="create/items.phtml">
17-
<block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="Magento_Shipping::create/items/renderer/default.phtml"/>
17+
<block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" name="shipment_item_default" as="shipment_item_default" template="Magento_Shipping::create/items/renderer/default.phtml"/>
1818
<block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="Magento_Sales::items/column/qty.phtml" group="column"/>
1919
<block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="Magento_Sales::items/column/name.phtml" group="column"/>
2020
<block class="Magento\Framework\View\Element\Text\ListText" name="order_item_extra_info"/>

app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<block class="Magento\Sales\Block\Adminhtml\Order\View\Info" name="order_info" template="Magento_Sales::order/view/info.phtml"/>
1515
<block class="Magento\Sales\Block\Adminhtml\Order\Payment" name="order_payment"/>
1616
<block class="Magento\Shipping\Block\Adminhtml\View\Items" name="shipment_items" template="view/items.phtml">
17-
<block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="Magento_Shipping::view/items/renderer/default.phtml"/>
17+
<block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" name="shipment_item_default" as="shipment_item_default" template="Magento_Shipping::view/items/renderer/default.phtml"/>
1818
<block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="Magento_Sales::items/column/qty.phtml" group="column"/>
1919
<block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="Magento_Sales::items/column/name.phtml" group="column"/>
2020
<block class="Magento\Framework\View\Element\Text\ListText" name="order_item_extra_info"/>

app/code/Magento/Ui/view/base/web/js/form/form.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ define([
5454
}
5555
break;
5656

57+
case 'select-multiple':
58+
var name = item.name.substring(0,(item.name.length - 2)); //remove [] from the name ending
59+
result[name] = _.pluck(item.selectedOptions, 'value');
60+
break;
61+
5762
default:
5863
result[item.name] = item.value;
5964
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"colinmollenhour/cache-backend-redis": "1.9",
3838
"colinmollenhour/cache-backend-file": "1.4",
3939
"composer/composer": "1.0.0-beta1",
40-
"monolog/monolog": "1.16.0",
40+
"monolog/monolog": "^1.17",
4141
"oyejorge/less.php": "~1.7.0",
4242
"pelago/emogrifier": "0.1.1",
4343
"tubalmartin/cssmin": "2.4.8-p4",

composer.lock

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute.php

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,51 +25,30 @@
2525

2626
/** @var $product \Magento\Catalog\Model\Product */
2727
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
28-
$product->setTypeId(
29-
\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
30-
)->setId(
31-
$optionIds[0] * 10
32-
)->setAttributeSetId(
33-
$installer->getAttributeSetId('catalog_product', 'Default')
34-
)->setWebsiteIds(
35-
[1]
36-
)->setName(
37-
'With Multiselect 1'
38-
)->setSku(
39-
'simple_ms_1'
40-
)->setPrice(
41-
10
42-
)->setVisibility(
43-
\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
44-
)->setMultiselectAttribute(
45-
[$optionIds[0]]
46-
)->setStatus(
47-
\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
48-
)->setStockData(
49-
['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]
50-
)->save();
28+
$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
29+
->setId($optionIds[0] * 10)
30+
->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default'))
31+
->setWebsiteIds([1])
32+
->setName('With Multiselect 1')
33+
->setSku('simple_ms_1')
34+
->setPrice(10)
35+
->setDescription('Hello " &amp;" Bring the water bottle when you can!')
36+
->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
37+
->setMultiselectAttribute([$optionIds[0]])
38+
->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
39+
->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1])
40+
->save();
5141

5242
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
53-
$product->setTypeId(
54-
\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
55-
)->setId(
56-
$optionIds[1] * 10
57-
)->setAttributeSetId(
58-
$installer->getAttributeSetId('catalog_product', 'Default')
59-
)->setWebsiteIds(
60-
[1]
61-
)->setName(
62-
'With Multiselect 2'
63-
)->setSku(
64-
'simple_ms_2'
65-
)->setPrice(
66-
10
67-
)->setVisibility(
68-
\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
69-
)->setMultiselectAttribute(
70-
[$optionIds[1], $optionIds[2], $optionIds[3]]
71-
)->setStatus(
72-
\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
73-
)->setStockData(
74-
['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]
75-
)->save();
43+
$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
44+
->setId($optionIds[1] * 10)
45+
->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default'))
46+
->setWebsiteIds([1])
47+
->setName('With Multiselect 2')
48+
->setSku('simple_ms_2')
49+
->setPrice(10)
50+
->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
51+
->setMultiselectAttribute([$optionIds[1], $optionIds[2], $optionIds[3]])
52+
->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
53+
->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1])
54+
->save();

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ abstract class AbstractProductExportImportTestCase extends \PHPUnit_Framework_Te
5656
'custom_design_from',
5757
'updated_in',
5858
'tax_class_id',
59+
'description'
5960
];
6061

6162
protected function setUp()

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,23 @@ public function testExport()
8787
$this->assertContains('test_option_code_2', $exportData);
8888
$this->assertContains('max_characters=10', $exportData);
8989
$this->assertContains('text_attribute=!@#$%^&*()_+1234567890-=|\\:;""\'<,>.?/', $exportData);
90+
$occurrencesCount = substr_count($exportData, 'Hello "" &"" Bring the water bottle when you can!');
91+
$this->assertEquals(1, $occurrencesCount);
92+
}
93+
94+
/**
95+
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data_special_chars.php
96+
* @magentoDbIsolationEnabled
97+
*/
98+
public function testExportSpecialChars()
99+
{
100+
$this->model->setWriter(
101+
$this->objectManager->create(
102+
\Magento\ImportExport\Model\Export\Adapter\Csv::class
103+
)
104+
);
105+
$exportData = $this->model->export();
106+
$this->assertContains('simple ""1""', $exportData);
90107
}
91108

92109
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
/** Create category */
7+
require dirname(dirname(__DIR__)) . '/Catalog/_files/category.php';
8+
/** Create fixture store */
9+
require dirname(dirname(__DIR__)) . '/Store/_files/second_store.php';
10+
/** Create product with multiselect attribute and values */
11+
require dirname(dirname(__DIR__)) . '/Catalog/_files/products_with_multiselect_attribute.php';
12+
/** Create dummy text attribute */
13+
require dirname(dirname(__DIR__)) . '/Catalog/_files/product_text_attribute.php';
14+
15+
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
16+
17+
/** @var \Magento\Catalog\Model\Product $productModel */
18+
$productModel = $objectManager->create(\Magento\Catalog\Model\Product::class);
19+
20+
$productModel->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
21+
->setId(1)
22+
->setAttributeSetId(4)
23+
->setName('New Product')
24+
->setSku('simple &quot;1&quot;')
25+
->setPrice(10)
26+
->addData(['text_attribute' => '!@#$%^&*()_+1234567890-=|\\:;"\'<,>.?/'])
27+
->setTierPrice([0 => ['website_id' => 0, 'cust_group' => 0, 'price_qty' => 3, 'price' => 8]])
28+
->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
29+
->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
30+
->setWebsiteIds([1])
31+
->setCateroryIds([])
32+
->setStockData(['qty' => 100, 'is_in_stock' => 1])
33+
->setCanSaveCustomOptions(true)
34+
->setCategoryIds([333])
35+
->setUpSellLinkData([$product->getId() => ['position' => 1]]);
36+
37+
$productModel->setOptions([])->save();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** Delete all products */
8+
require dirname(dirname(__DIR__)) . '/Catalog/_files/products_with_multiselect_attribute_rollback.php';
9+
/** Delete text attribute */
10+
require dirname(dirname(__DIR__)) . '/Catalog/_files/text_attribute_rollback.php';

0 commit comments

Comments
 (0)