Skip to content

Commit ad04a2f

Browse files
authored
ENGCOM-3584: Sample Link Issue in Downloadable product in magento-2.2.6 #19344 #19431
2 parents d821363 + 871ddbb commit ad04a2f

File tree

1 file changed

+7
-0
lines changed
  • app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin

1 file changed

+7
-0
lines changed

app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\Downloadable\Api\Data\SampleInterfaceFactory;
1212
use Magento\Downloadable\Api\Data\LinkInterfaceFactory;
1313

14+
/**
15+
* Class for initialization downloadable info from request.
16+
*/
1417
class Downloadable
1518
{
1619
/**
@@ -92,6 +95,8 @@ public function afterInitialize(
9295
}
9396
}
9497
$extension->setDownloadableProductLinks($links);
98+
} else {
99+
$extension->setDownloadableProductLinks([]);
95100
}
96101
if (isset($downloadable['sample']) && is_array($downloadable['sample'])) {
97102
$samples = [];
@@ -107,6 +112,8 @@ public function afterInitialize(
107112
}
108113
}
109114
$extension->setDownloadableProductSamples($samples);
115+
} else {
116+
$extension->setDownloadableProductSamples([]);
110117
}
111118
$product->setExtensionAttributes($extension);
112119
if ($product->getLinksPurchasedSeparately()) {

0 commit comments

Comments
 (0)