Skip to content

Commit 90cbb60

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #594 from magento-sparta/SUPEE-6842
[SUPPORT] Merchant Beta Bug Fixes
2 parents ef89599 + 70542a3 commit 90cbb60

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ define([
380380
var $checkbox = $(event.currentTarget);
381381
var $imageContainer = $checkbox.closest('[data-role=dialog]').data('imageContainer');
382382
$imageContainer.toggleClass('hidden-for-front', $checkbox.is(':checked'));
383+
$imageContainer.find('[name*="disabled"]').val($checkbox.is(':checked') ? 1 : 0);
383384
},
384385

385386
/**

app/code/Magento/Developer/Console/Command/CssDeployCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
219219
]
220220
);
221221

222+
$rootDir = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
222223
$sourceFile = $this->assetSource->findSource($asset);
223-
$content = \file_get_contents($sourceFile);
224+
$relativePath = $rootDir->getRelativePath($sourceFile);
225+
$content = $rootDir->readFile($relativePath);
224226

225227
$chain = $this->chainFactory->create(
226228
[
227229
'asset' => $asset,
228230
'origContent' => $content,
229-
'origContentType' => $asset->getContentType()
231+
'origContentType' => $asset->getContentType(),
232+
'origAssetPath' => $relativePath
230233
]
231234
);
232235

233236
$processedCoreFile = $sourceFileGenerator->generateFileTree($chain);
234237

235238
$targetDir = $this->filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW);
236-
$rootDir = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
237239
$source = $rootDir->getRelativePath($processedCoreFile);
238240
$destination = $asset->getPath();
239241
$rootDir->copyFile($source, $destination, $targetDir);

app/code/Magento/Developer/Test/Unit/Console/Command/CssDeployCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public function testExecute()
113113
->method('create')
114114
->with('less')
115115
->willReturn($this->getMock('Magento\Framework\Less\FileGenerator', [], [], '', false));
116+
$asset = $this->getMockForAbstractClass('Magento\Framework\View\Asset\LocalInterface');
117+
$asset->expects($this->once())->method('getContentType')->willReturn('type');
116118
$this->assetRepo->expects($this->once())
117119
->method('createAsset')
118120
->with(
@@ -123,9 +125,7 @@ public function testExecute()
123125
'locale' => 'en_US'
124126
]
125127
)
126-
->willReturn(
127-
$this->getMockForAbstractClass('Magento\Framework\View\Asset\LocalInterface')
128-
);
128+
->willReturn($asset);
129129
$this->assetSource->expects($this->once())->method('findSource')->willReturn('/dev/null');
130130

131131
$this->chainFactory->expects($this->once())->method('create')->willReturn(

lib/internal/Magento/Framework/Less/PreProcessor/Instruction/Import.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ public function process(\Magento\Framework\View\Asset\PreProcessor\Chain $chain)
5151
return $this->replace($matchContent, $asset);
5252
};
5353
$content = $this->removeComments($chain->getContent());
54-
$chain->setContent(preg_replace_callback(self::REPLACE_PATTERN, $replaceCallback, $content));
54+
55+
$processedContent = preg_replace_callback(self::REPLACE_PATTERN, $replaceCallback, $content);
56+
57+
if ($processedContent !== $content) {
58+
$chain->setContent($processedContent);
59+
}
5560
}
5661

5762
/**

0 commit comments

Comments
 (0)