Skip to content

Commit de44fd9

Browse files
MAGETWO-87974: Can't hide product images via hide_from_product_page attribute during import
- Fix static test
1 parent b3ca6a1 commit de44fd9

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

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

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,8 @@ public function isAttributeValid($attrCode, array $attrParams, array $rowData, $
898898
}
899899

900900
/**
901-
*
902901
* Multiple value separator getter.
902+
*
903903
* @return string
904904
*/
905905
public function getMultipleValueSeparator()
@@ -949,6 +949,8 @@ public function getMediaGalleryAttributeId()
949949
}
950950

951951
/**
952+
* Get product by type name.
953+
*
952954
* @param string $name
953955
* @return Product\Type\AbstractType
954956
*/
@@ -1189,8 +1191,10 @@ protected function _initErrorTemplates()
11891191
}
11901192

11911193
/**
1192-
* Set valid attribute set and product type to rows with all scopes
1193-
* to ensure that existing products doesn't changed.
1194+
* Set valid attribute set and product type to rows.
1195+
*
1196+
* Set valid attribute set and product type to rows with all
1197+
* scopes to ensure that existing products doesn't changed.
11941198
*
11951199
* @param array $rowData
11961200
* @return array
@@ -1220,6 +1224,7 @@ protected function _prepareRowForDb(array $rowData)
12201224

12211225
/**
12221226
* Gather and save information about product links.
1227+
*
12231228
* Must be called after ALL products saving done.
12241229
*
12251230
* @return $this
@@ -1468,6 +1473,7 @@ public function saveProductEntity(array $entityRowsIn, array $entityRowsUp)
14681473

14691474
/**
14701475
* Return additional data, needed to select.
1476+
*
14711477
* @return array
14721478
*/
14731479
private function getOldSkuFieldsForSelect()
@@ -1477,6 +1483,7 @@ private function getOldSkuFieldsForSelect()
14771483

14781484
/**
14791485
* Adds newly created products to _oldSku
1486+
*
14801487
* @param array $newProducts
14811488
* @return void
14821489
*/
@@ -1514,6 +1521,7 @@ private function getNewSkuFieldsForSelect()
15141521

15151522
/**
15161523
* Init media gallery resources
1524+
*
15171525
* @return void
15181526
* @since 100.0.4
15191527
* @deprecated
@@ -1544,6 +1552,8 @@ protected function getExistingImages($bunch)
15441552
}
15451553

15461554
/**
1555+
* Retrieve image from row.
1556+
*
15471557
* @param array $rowData
15481558
* @return array
15491559
*/
@@ -1937,6 +1947,7 @@ protected function _saveProducts()
19371947

19381948
/**
19391949
* Prepare array with image states (visible or hidden from product page)
1950+
*
19401951
* @param array $rowData
19411952
* @return array
19421953
*/
@@ -1961,6 +1972,8 @@ private function getImagesHiddenStates($rowData)
19611972
}
19621973

19631974
/**
1975+
* Process row categories.
1976+
*
19641977
* @param array $rowData
19651978
* @return array
19661979
*/
@@ -1988,6 +2001,8 @@ protected function processRowCategories($rowData)
19882001
}
19892002

19902003
/**
2004+
* Get product websites.
2005+
*
19912006
* @param string $productSku
19922007
* @return array
19932008
*/
@@ -1997,6 +2012,8 @@ public function getProductWebsites($productSku)
19972012
}
19982013

19992014
/**
2015+
* Retrieve product categories.
2016+
*
20002017
* @param string $productSku
20012018
* @return array
20022019
*/
@@ -2006,6 +2023,8 @@ public function getProductCategories($productSku)
20062023
}
20072024

20082025
/**
2026+
* Get store id by code.
2027+
*
20092028
* @param string $storeCode
20102029
* @return array|int|null|string
20112030
*/
@@ -2097,6 +2116,8 @@ protected function _getUploader()
20972116
}
20982117

20992118
/**
2119+
* Retrieve uploader.
2120+
*
21002121
* @return Uploader
21012122
* @throws \Magento\Framework\Exception\LocalizedException
21022123
*/
@@ -2107,6 +2128,7 @@ public function getUploader()
21072128

21082129
/**
21092130
* Uploading files into the "catalog/product" media folder.
2131+
*
21102132
* Return a new file name if the same file is already exists.
21112133
*
21122134
* @param string $fileName
@@ -2301,7 +2323,7 @@ public function getEntityTypeCode()
23012323
* Returns array of new products data with SKU as key. All SKU keys are in lowercase for avoiding creation of
23022324
* new products with the same SKU in different letter cases.
23032325
*
2304-
* @var string $sku
2326+
* @param string $sku
23052327
* @return array
23062328
*/
23072329
public function getNewSku($sku = null)
@@ -2494,6 +2516,8 @@ public function validateRow(array $rowData, $rowNum)
24942516
}
24952517

24962518
/**
2519+
* Check if need to validate url key.
2520+
*
24972521
* @param array $rowData
24982522
* @return bool
24992523
*/
@@ -2805,8 +2829,11 @@ protected function getProductUrlSuffix($storeId = null)
28052829
}
28062830

28072831
/**
2832+
* Get url key.
2833+
*
28082834
* @param array $rowData
28092835
* @return string
2836+
*
28102837
* @since 100.0.3
28112838
*/
28122839
protected function getUrlKey($rowData)
@@ -2823,7 +2850,10 @@ protected function getUrlKey($rowData)
28232850
}
28242851

28252852
/**
2853+
* Retrieve resource.
2854+
*
28262855
* @return Proxy\Product\ResourceModel
2856+
*
28272857
* @since 100.0.3
28282858
*/
28292859
protected function getResource()

app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct(
103103
/**
104104
* Save product media gallery.
105105
*
106-
* @param $mediaGalleryData
106+
* @param array $mediaGalleryData
107107
* @return void
108108
*/
109109
public function saveMediaGallery(array $mediaGalleryData)
@@ -159,7 +159,7 @@ public function updateMediaGalleryLabels(array $labels)
159159
/**
160160
* Update 'disabled' field for media gallery entity
161161
*
162-
* @param array $labels
162+
* @param array $images
163163
* @return void
164164
*/
165165
public function updateMediaGalleryVisibility(array $images)
@@ -287,7 +287,7 @@ private function initMediaGalleryResources()
287287
/**
288288
* Save media gallery data per store.
289289
*
290-
* @param $storeId
290+
* @param int $storeId
291291
* @param array $mediaGalleryData
292292
* @param array $newMediaValues
293293
* @param array $valueToProductId
@@ -363,6 +363,8 @@ private function getProductEntityLinkField()
363363
}
364364

365365
/**
366+
* Get resource.
367+
*
366368
* @return \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModel
367369
*/
368370
private function getResource()

0 commit comments

Comments
 (0)