diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset/element.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset/element.phtml index b09be9491f003..c11293d6ae71c 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset/element.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset/element.phtml @@ -12,7 +12,7 @@ $element = $block->getElement(); $note = $element->getNote() ? '
' . $element->getNote() . '
' : ''; $elementBeforeLabel = $element->getExtType() == 'checkbox admin__control-checkbox' || $element->getExtType() == 'radio admin__control-radio'; -$addOn = $element->getBeforeElementHtml() || $element->getAfterElementHtml(); +$addOn = ($element->getBeforeElementHtml() || $element->getAfterElementHtml()) && !$element->getNoWrapAsAddon(); $fieldId = ($element->getHtmlContainerId()) ? ' id="' . $element->getHtmlContainerId() . '"' : ''; $fieldClass = "admin__field field field-{$element->getId()} {$element->getCssClass()}"; $fieldClass .= ($elementBeforeLabel) ? ' choice' : ''; diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml index 30d421cfe8594..9242521462141 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml @@ -8,7 +8,9 @@ - + + + diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 09c883b094a94..1e8fcbc4aa07b 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1803,7 +1803,7 @@ protected function _saveMediaGallery(array $mediaGalleryData) 'value' => $insertValue['value'], ]; $valueToProductId[$insertValue['value']] = $productId; - $imageNames = $insertValue['value']; + $imageNames[] = $insertValue['value']; $multiInsertData[] = $valueArr; $insertedGalleryImgs[] = $insertValue['value']; } diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml index 9c58b7a7fb6a6..8a1b3edc8053e 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml @@ -225,14 +225,6 @@ - - -
@@ -441,14 +433,6 @@ - - -
diff --git a/app/code/Magento/Customer/Block/CustomerData.php b/app/code/Magento/Customer/Block/CustomerData.php index 66d4043f152e6..9d30a56de217b 100644 --- a/app/code/Magento/Customer/Block/CustomerData.php +++ b/app/code/Magento/Customer/Block/CustomerData.php @@ -7,24 +7,14 @@ class CustomerData extends \Magento\Framework\View\Element\Template { - /** - * Sections that can not be cached on frontend-side - * - * @var array - */ - protected $nonCachedSections = []; - /** * @param \Magento\Framework\View\Element\Template\Context $context * @param array $data - * @param array $nonCachedSections */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - array $data = [], - array $nonCachedSections = [] + array $data = [] ) { - $this->nonCachedSections = $nonCachedSections; parent::__construct($context, $data); } @@ -50,24 +40,4 @@ public function getCustomerDataUrl($route) { return $this->getUrl($route, ['_secure' => $this->getRequest()->isSecure()]); } - - /** - * Get sections that can not be cached on frontend-side - * - * @return array - */ - public function getNotCachedSections() - { - return $this->nonCachedSections; - } - - /** - * Get keys of sections that can not be cached on frontend-side - * - * @return array - */ - public function getNonCachedSectionKeys() - { - return array_keys($this->nonCachedSections); - } } diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php new file mode 100644 index 0000000000000..7e1b9f9d43779 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php @@ -0,0 +1,164 @@ +reporting = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\DataProvider\Reporting') + ->disableOriginalConstructor() + ->getMock(); + + $searchCriteriaBuilder = $this->mockSearchCriteria(); + + $this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->getMockForAbstractClass(); + + $this->filterBuilder = $this->getMockBuilder('Magento\Framework\Api\FilterBuilder') + ->disableOriginalConstructor() + ->getMock(); + + $this->attributeRepository = $this->getMockBuilder('Magento\Customer\Ui\Component\Listing\AttributeRepository') + ->disableOriginalConstructor() + ->getMock(); + + $this->model = new DataProvider( + self::TEST_REQUEST_NAME, + '', + '', + $this->reporting, + $searchCriteriaBuilder, + $this->request, + $this->filterBuilder, + $this->attributeRepository + ); + } + + public function testGetData() + { + $attributeCode = 'attribute_code'; + $attributeValue = [ + AttributeMetadataInterface::OPTIONS => [ + [ + 'label' => 'opt1_label', + 'value' => 'opt1_value', + ], + ], + ]; + + $expected = [ + [ + 'attribute_code' => ['opt1_value'], + ], + ]; + + $attributeMock = $this->getMockBuilder('Magento\Framework\Api\AttributeInterface') + ->getMockForAbstractClass(); + $attributeMock->expects($this->once()) + ->method('getAttributeCode') + ->willReturn($attributeCode); + $attributeMock->expects($this->once()) + ->method('getValue') + ->willReturn('opt1_value'); + + $searchDocumentMock = $this->getMockBuilder('Magento\Framework\Api\Search\DocumentInterface') + ->getMockForAbstractClass(); + $searchDocumentMock->expects($this->once()) + ->method('getCustomAttributes') + ->willReturn([$attributeMock]); + + $searchResultMock = $this->getMockBuilder('Magento\Framework\Api\Search\SearchResultInterface') + ->getMockForAbstractClass(); + $searchResultMock->expects($this->once()) + ->method('getTotalCount') + ->willReturn(1); + $searchResultMock->expects($this->once()) + ->method('getItems') + ->willReturn([$searchDocumentMock]); + + $this->searchCriteria->expects($this->once()) + ->method('setRequestName') + ->with(self::TEST_REQUEST_NAME) + ->willReturnSelf(); + + $this->reporting->expects($this->once()) + ->method('search') + ->with($this->searchCriteria) + ->willReturn($searchResultMock); + + $this->attributeRepository->expects($this->once()) + ->method('getList') + ->willReturn([$attributeCode => $attributeValue]); + + $result = $this->model->getData(); + + $this->assertTrue(is_array($result)); + $this->assertArrayHasKey('totalRecords', $result); + $this->assertEquals(1, $result['totalRecords']); + $this->assertArrayHasKey('items', $result); + $this->assertTrue(is_array($result['items'])); + $this->assertEquals($result['items'], $expected); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function mockSearchCriteria() + { + $this->searchCriteria = $this->getMockBuilder('Magento\Framework\Api\Search\SearchCriteriaInterface') + ->getMockForAbstractClass(); + + $searchCriteriaBuilder = $this->getMockBuilder('Magento\Framework\Api\Search\SearchCriteriaBuilder') + ->disableOriginalConstructor() + ->getMock(); + + $searchCriteriaBuilder->expects($this->any()) + ->method('create') + ->willReturn($this->searchCriteria); + + return $searchCriteriaBuilder; + } +} diff --git a/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml b/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml index 60441eb039d72..b34e7c871d3bf 100644 --- a/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml @@ -13,7 +13,6 @@ '*' => ['Magento_Customer/js/customer-data' => [ 'sectionLoadUrl' => $block->getCustomerDataUrl('customer/section/load'), 'cookieLifeTime' => $block->getCookieLifeTime(), - 'nonCachedSections' => $block->getNonCachedSectionKeys(), ]], ]); ?> diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index ae42dc978922e..f4f79932d397c 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -23,8 +23,6 @@ define([ storage.removeAll(); var date = new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000); $.localStorage.set('mage-cache-timeout', date); - } else { - invalidateNonCachedSections(options); } }; @@ -35,12 +33,6 @@ define([ } }; - var invalidateNonCachedSections = function(options) { - _.each(options.nonCachedSections, function (sectionName) { - storageInvalidation.set(sectionName, true); - }); - } - var dataProvider = { getFromStorage: function (sectionNames) { var result = {}; diff --git a/app/code/Magento/SampleData/Model/BlackHole.php b/app/code/Magento/SampleData/Model/BlackHole.php deleted file mode 100644 index 06f557d318484..0000000000000 --- a/app/code/Magento/SampleData/Model/BlackHole.php +++ /dev/null @@ -1,22 +0,0 @@ - - - - Magento\SampleData\Model\BlackHole - - - - - Magento\SampleData\Model\BlackHoleFactory - - - - - blackHoleTransportBuilder - - - - - sampleDataAccountManagement - - diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/packed.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/packed.phtml index 821d5065ac63d..1779164460f2e 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/packed.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/packed.phtml @@ -7,184 +7,170 @@ // @codingStandardsIgnoreFile ?> - -