Skip to content

Commit f4876ca

Browse files
authored
WebAssetManager: reset sorting state when new item enabled or disabled (#42880)
1 parent 4dbea00 commit f4876ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/src/WebAsset/WebAssetManager.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ public function useAsset(string $type, string $name): WebAssetManagerInterface
297297
$this->dependenciesIsActual = false;
298298
}
299299

300+
// To re-order assets
301+
$this->sortedAssets[$type] = [];
302+
300303
return $this;
301304
}
302305

@@ -327,6 +330,9 @@ public function disableAsset(string $type, string $name): WebAssetManagerInterfa
327330
// To re-check dependencies
328331
$this->dependenciesIsActual = false;
329332

333+
// To re-order assets
334+
$this->sortedAssets[$type] = [];
335+
330336
// For Preset case
331337
if ($type === 'preset') {
332338
$this->disablePresetItems($name);

0 commit comments

Comments
 (0)