Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ protected function _loadScopedData()
}
$this->_scopePriorityScheme[] = $scope;

$cacheId = implode('|', $this->_scopePriorityScheme) . "|" . $this->_cacheId;
// Normalize cache ID by sorting scopes - ensures consistent ID regardless of processing order
$sortedScheme = array_values($this->_scopePriorityScheme);
sort($sortedScheme);
$cacheId = implode('|', $sortedScheme) . "|" . $this->_cacheId;
$configData = $this->configLoader->load($cacheId);

if ($configData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ public function write(array $scopes): void
foreach ($scopes as $scope) {
$this->scopeConfig->setCurrentScope($scope);
if (false === isset($this->loadedScopes[$scope])) {
if (false === in_array($scope, $this->scopePriorityScheme, true)) {
$this->scopePriorityScheme[] = $scope;
// Match PluginList::_loadScopedData() behavior - move scope to end
// This ensures cache IDs match between compile-time and runtime
$index = array_search($scope, $this->scopePriorityScheme, true);
if ($index !== false) {
unset($this->scopePriorityScheme[$index]);
}
$cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
$this->scopePriorityScheme[] = $scope;
// Normalize cache ID by sorting scopes - ensures consistent ID regardless of processing order
$sortedScheme = array_values($this->scopePriorityScheme);
sort($sortedScheme);
$cacheId = implode('|', $sortedScheme) . "|" . $this->cacheId;
[
$virtualTypes,
$this->scopePriorityScheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ public function __construct(
public function doOperation()
{
$scopes = $this->scopeConfig->getAllScopes();
// remove primary scope for production mode as it is only called in developer mode
$scopes = array_diff($scopes, ['primary']);

// sort configuration to have it in the same order on every build
ksort($scopes);

// Cache IDs are now normalized (sorted) in PluginListGenerator::write()
// so processing order no longer affects cache ID generation
$this->configWriter->write($scopes);
}

Expand Down