Skip to content

Commit 954d9d5

Browse files
mrtuvntuna2smc
authored andcommitted
Update MagentoImport.php
Update check import
1 parent 169c42d commit 954d9d5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/internal/Magento/Framework/Css/PreProcessor/Instruction/MagentoImport.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,17 @@ protected function replace(array $matchedContent, LocalInterface $asset)
139139
/** @var $importFile \Magento\Framework\View\File */
140140
foreach ($importFiles as $importFile) {
141141
$moduleName = $importFile->getModule();
142-
143-
if ($moduleName && $deployOnlyEnabled && !$this->moduleManager->isEnabled($moduleName)) {
142+
143+
if ($moduleName && !$deployOnlyEnabled && !$this->moduleManager->isEnabled($moduleName)) {
144144
continue;
145145
}
146146

147-
$referenceString = $isReference ? '(reference) ' : '';
148-
$importsContent .= $moduleName
149-
? "@import $referenceString'{$moduleName}::{$resolvedPath}';\n"
150-
: "@import $referenceString'{$matchedFileId}';\n";
147+
if ($moduleName && $deployOnlyEnabled && $this->moduleManager->isEnabled($moduleName)) {
148+
$referenceString = $isReference ? '(reference) ' : '';
149+
$importsContent .= $moduleName
150+
? "@import $referenceString'{$moduleName}::{$resolvedPath}';\n"
151+
: "@import $referenceString'{$matchedFileId}';\n";
152+
}
151153
}
152154
} catch (\LogicException $e) {
153155
$this->errorHandler->processException($e);

0 commit comments

Comments
 (0)