Skip to content

Commit

Permalink
Fixed Changing sample for downloadable product failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-chandra3197 committed Apr 24, 2019
1 parent 5358ec9 commit 9aff2a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/code/Magento/Downloadable/Model/SampleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,11 @@ protected function updateSample(
$existingSample->setTitle($sample->getTitle());
}

if ($sample->getSampleType() === 'file' && $sample->getSampleFileContent() === null) {
$sample->setSampleFile($existingSample->getSampleFile());
if ($sample->getSampleType() === 'file'
&& $sample->getSampleFileContent() === null
&& $sample->getSampleFile() !== null
) {
$existingSample->setSampleFile($sample->getSampleFile());
}
$this->saveSample($product, $sample, $isGlobalScopeContent);
return $existingSample->getId();
Expand Down

0 comments on commit 9aff2a9

Please sign in to comment.