Skip to content

Commit

Permalink
[TASK] Re-order a couple of variable assignments in AssetService
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Jul 24, 2023
1 parent 390beb4 commit 7b1ea83
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Classes/Service/AssetService.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,12 +657,11 @@ protected function buildAsset($asset): ?string
protected function extractAssetContent($asset): ?string
{
$assetSettings = $this->extractAssetSettings($asset);
$fileRelativePathAndFilename = $assetSettings['path'];
$fileRelativePath = dirname($assetSettings['path'] ?? '');
$absolutePathAndFilename = GeneralUtility::getFileAbsFileName($fileRelativePathAndFilename);
$isExternal = $assetSettings['external'] ?? false;
$isFluidTemplate = $assetSettings['fluid'] ?? false;
$fileRelativePathAndFilename = $assetSettings['path'] ?? null;
if (!empty($fileRelativePathAndFilename)) {
$isExternal = $assetSettings['external'] ?? false;
$isFluidTemplate = $assetSettings['fluid'] ?? false;
$absolutePathAndFilename = GeneralUtility::getFileAbsFileName($fileRelativePathAndFilename);
if (!$isExternal && !file_exists($absolutePathAndFilename)) {
throw new \RuntimeException('Asset "' . $absolutePathAndFilename . '" does not exist.');
}
Expand All @@ -675,6 +674,7 @@ protected function extractAssetContent($asset): ?string
$content = $this->buildAsset($asset);
}
if ($content !== null && 'css' === $assetSettings['type'] && ($assetSettings['rewrite'] ?? false)) {
$fileRelativePath = dirname($assetSettings['path'] ?? '');
$content = $this->detectAndCopyFileReferences($content, $fileRelativePath);
}
return $content;
Expand Down

0 comments on commit 7b1ea83

Please sign in to comment.