Skip to content

Commit 5a215c3

Browse files
author
Oleksandr Dubovyk
committed
MAGETWO-98729: [2.3] [Magento Cloud] Translated Arabic URL's are returning 404's
- fixed static
1 parent 6f4f511 commit 5a215c3

File tree

1 file changed

+33
-19
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+33
-19
lines changed

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

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,12 @@ public function setParameters(array $params)
10001000
*/
10011001
public function deleteProductsForReplacement()
10021002
{
1003-
$this->setParameters(array_merge(
1004-
$this->getParameters(),
1005-
['behavior' => Import::BEHAVIOR_DELETE]
1006-
));
1003+
$this->setParameters(
1004+
array_merge(
1005+
$this->getParameters(),
1006+
['behavior' => Import::BEHAVIOR_DELETE]
1007+
)
1008+
);
10071009
$this->_deleteProducts();
10081010

10091011
return $this;
@@ -1092,10 +1094,12 @@ protected function _replaceProducts()
10921094
$this->deleteProductsForReplacement();
10931095
$this->_oldSku = $this->skuProcessor->reloadOldSkus()->getOldSkus();
10941096
$this->_validatedRows = null;
1095-
$this->setParameters(array_merge(
1096-
$this->getParameters(),
1097-
['behavior' => Import::BEHAVIOR_APPEND]
1098-
));
1097+
$this->setParameters(
1098+
array_merge(
1099+
$this->getParameters(),
1100+
['behavior' => Import::BEHAVIOR_APPEND]
1101+
)
1102+
);
10991103
$this->_saveProductsData();
11001104

11011105
return $this;
@@ -2626,9 +2630,12 @@ public function parseMultiselectValues($values, $delimiter = self::PSEUDO_MULTI_
26262630
return explode($delimiter, $values);
26272631
}
26282632
if (preg_match_all('~"((?:[^"]|"")*)"~', $values, $matches)) {
2629-
return $values = array_map(function ($value) {
2630-
return str_replace('""', '"', $value);
2631-
}, $matches[1]);
2633+
return $values = array_map(
2634+
function ($value) {
2635+
return str_replace('""', '"', $value);
2636+
},
2637+
$matches[1]
2638+
);
26322639
}
26332640
return [$values];
26342641
}
@@ -3053,20 +3060,27 @@ private function processLinkBunches(
30533060
$productId = $this->skuProcessor->getNewSku($sku)[$this->getProductEntityLinkField()];
30543061
$productIds[] = $productId;
30553062
$productLinkKeys = $this->fetchProductLinks($resource, $productId);
3056-
$linkNameToId = array_filter($this->_linkNameToId, function ($linkName) use ($rowData) {
3057-
return isset($rowData[$linkName . 'sku']);
3058-
}, ARRAY_FILTER_USE_KEY);
3063+
$linkNameToId = array_filter(
3064+
$this->_linkNameToId,
3065+
function ($linkName) use ($rowData) {
3066+
return isset($rowData[$linkName . 'sku']);
3067+
},
3068+
ARRAY_FILTER_USE_KEY
3069+
);
30593070
foreach ($linkNameToId as $linkName => $linkId) {
30603071
$linkSkus = explode($this->getMultipleValueSeparator(), $rowData[$linkName . 'sku']);
30613072
$linkPositions = !empty($rowData[$linkName . 'position'])
30623073
? explode($this->getMultipleValueSeparator(), $rowData[$linkName . 'position'])
30633074
: [];
30643075

3065-
$linkSkus = array_filter($linkSkus, function ($linkedSku) use ($sku) {
3066-
$linkedSku = trim($linkedSku);
3067-
return ($this->skuProcessor->getNewSku($linkedSku) !== null || $this->isSkuExist($linkedSku))
3068-
&& strcasecmp($linkedSku, $sku) !== 0;
3069-
});
3076+
$linkSkus = array_filter(
3077+
$linkSkus,
3078+
function ($linkedSku) use ($sku) {
3079+
$linkedSku = trim($linkedSku);
3080+
return ($this->skuProcessor->getNewSku($linkedSku) !== null || $this->isSkuExist($linkedSku))
3081+
&& strcasecmp($linkedSku, $sku) !== 0;
3082+
}
3083+
);
30703084
foreach ($linkSkus as $linkedKey => $linkedSku) {
30713085
$linkedId = $this->getProductLinkedId($linkedSku);
30723086
if ($linkedId == null) {

0 commit comments

Comments
 (0)