Skip to content

Commit 7cd48fc

Browse files
Fixed Changing sample for downloadable product failure
1 parent 5f976fa commit 7cd48fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/code/Magento/Downloadable/Model/SampleRepository.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,11 @@ protected function updateSample(
308308
$existingSample->setTitle($sample->getTitle());
309309
}
310310

311-
if ($sample->getSampleType() === 'file' && $sample->getSampleFileContent() === null) {
312-
$sample->setSampleFile($existingSample->getSampleFile());
311+
if ($sample->getSampleType() === 'file'
312+
&& $sample->getSampleFileContent() === null
313+
&& $sample->getSampleFile() !== null
314+
) {
315+
$existingSample->setSampleFile($sample->getSampleFile());
313316
}
314317
$this->saveSample($product, $sample, $isGlobalScopeContent);
315318
return $existingSample->getId();

0 commit comments

Comments
 (0)