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 Original file line number Diff line number Diff line change 11
11
use Magento \Downloadable \Api \Data \SampleInterfaceFactory ;
12
12
use Magento \Downloadable \Api \Data \LinkInterfaceFactory ;
13
13
14
+ /**
15
+ * Class for initialization downloadable info from request.
16
+ */
14
17
class Downloadable
15
18
{
16
19
/**
@@ -92,6 +95,8 @@ public function afterInitialize(
92
95
}
93
96
}
94
97
$ extension ->setDownloadableProductLinks ($ links );
98
+ } else {
99
+ $ extension ->setDownloadableProductLinks ([]);
95
100
}
96
101
if (isset ($ downloadable ['sample ' ]) && is_array ($ downloadable ['sample ' ])) {
97
102
$ samples = [];
@@ -107,6 +112,8 @@ public function afterInitialize(
107
112
}
108
113
}
109
114
$ extension ->setDownloadableProductSamples ($ samples );
115
+ } else {
116
+ $ extension ->setDownloadableProductSamples ([]);
110
117
}
111
118
$ product ->setExtensionAttributes ($ extension );
112
119
if ($ product ->getLinksPurchasedSeparately ()) {
You can’t perform that action at this time.
0 commit comments