Skip to content

Commit 0bfc522

Browse files
mrtuvntuna2smc
authored andcommitted
Update MagentoImport.php
Update logic check
1 parent 3c13863 commit 0bfc522

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +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-
if ($moduleName && $deployOnlyEnabled && !$this->moduleManager->isEnabled($moduleName)) {
148-
continue;
147+
if (!$deployOnlyEnabled || ($moduleName && $deployOnlyEnabled && $this->moduleManager->isEnabled($moduleName))) {
148+
$referenceString = $isReference ? '(reference) ' : '';
149+
$importsContent .= $moduleName
150+
? "@import $referenceString'{$moduleName}::{$resolvedPath}';\n"
151+
: "@import $referenceString'{$matchedFileId}';\n";
149152
}
150-
151-
$referenceString = $isReference ? '(reference) ' : '';
152-
$importsContent .= $moduleName
153-
? "@import $referenceString'{$moduleName}::{$resolvedPath}';\n"
154-
: "@import $referenceString'{$matchedFileId}';\n";
155153
}
156154
} catch (\LogicException $e) {
157155
$this->errorHandler->processException($e);

0 commit comments

Comments
 (0)