Skip to content

Commit

Permalink
Merge pull request #594 from magento-sparta/SUPEE-6842
Browse files Browse the repository at this point in the history
[SUPPORT] Merchant Beta Bug Fixes
  • Loading branch information
Korshenko, Olexii(okorshenko) committed Sep 21, 2015
2 parents ef89599 + 70542a3 commit 90cbb60
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ define([
var $checkbox = $(event.currentTarget);
var $imageContainer = $checkbox.closest('[data-role=dialog]').data('imageContainer');
$imageContainer.toggleClass('hidden-for-front', $checkbox.is(':checked'));
$imageContainer.find('[name*="disabled"]').val($checkbox.is(':checked') ? 1 : 0);
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
]
);

$rootDir = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
$sourceFile = $this->assetSource->findSource($asset);
$content = \file_get_contents($sourceFile);
$relativePath = $rootDir->getRelativePath($sourceFile);
$content = $rootDir->readFile($relativePath);

$chain = $this->chainFactory->create(
[
'asset' => $asset,
'origContent' => $content,
'origContentType' => $asset->getContentType()
'origContentType' => $asset->getContentType(),
'origAssetPath' => $relativePath
]
);

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

$targetDir = $this->filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW);
$rootDir = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
$source = $rootDir->getRelativePath($processedCoreFile);
$destination = $asset->getPath();
$rootDir->copyFile($source, $destination, $targetDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public function testExecute()
->method('create')
->with('less')
->willReturn($this->getMock('Magento\Framework\Less\FileGenerator', [], [], '', false));
$asset = $this->getMockForAbstractClass('Magento\Framework\View\Asset\LocalInterface');
$asset->expects($this->once())->method('getContentType')->willReturn('type');
$this->assetRepo->expects($this->once())
->method('createAsset')
->with(
Expand All @@ -123,9 +125,7 @@ public function testExecute()
'locale' => 'en_US'
]
)
->willReturn(
$this->getMockForAbstractClass('Magento\Framework\View\Asset\LocalInterface')
);
->willReturn($asset);
$this->assetSource->expects($this->once())->method('findSource')->willReturn('/dev/null');

$this->chainFactory->expects($this->once())->method('create')->willReturn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ public function process(\Magento\Framework\View\Asset\PreProcessor\Chain $chain)
return $this->replace($matchContent, $asset);
};
$content = $this->removeComments($chain->getContent());
$chain->setContent(preg_replace_callback(self::REPLACE_PATTERN, $replaceCallback, $content));

$processedContent = preg_replace_callback(self::REPLACE_PATTERN, $replaceCallback, $content);

if ($processedContent !== $content) {
$chain->setContent($processedContent);
}
}

/**
Expand Down

0 comments on commit 90cbb60

Please sign in to comment.