Skip to content
Merged
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
13 changes: 5 additions & 8 deletions src/services/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -854,14 +854,11 @@ public function updatePluginVersionInfo(PluginInterface $plugin): void
$this->_storedPluginInfo[$plugin->id]['schemaVersion'] = $plugin->schemaVersion;
}

// Only update the schema version if it's changed from what's in the file,
// so we don't accidentally overwrite other pending changes
$projectConfig = Craft::$app->getProjectConfig();
$key = ProjectConfig::PATH_PLUGINS . ".$plugin->id.schemaVersion";

if ($projectConfig->get($key, true) !== $plugin->schemaVersion) {
Craft::$app->getProjectConfig()->set($key, $plugin->schemaVersion, "Update plugin schema version for “{$plugin->handle}”");
}
Craft::$app->getProjectConfig()->set(
sprintf('%s.%s.schemaVersion', ProjectConfig::PATH_PLUGINS, $plugin->id),
$plugin->schemaVersion,
"Update plugin schema version for “{$plugin->handle}”",
);
}

/**
Expand Down
11 changes: 5 additions & 6 deletions src/services/Updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,11 @@ public function updateCraftVersionInfo(): bool

Craft::$app->saveInfo($info);

// Only update the schema version if it's changed from what's in the file,
// so we don't accidentally overwrite other pending changes
$projectConfig = Craft::$app->getProjectConfig();
if ($projectConfig->get(ProjectConfig::PATH_SCHEMA_VERSION, true) !== $info->schemaVersion) {
Craft::$app->getProjectConfig()->set(ProjectConfig::PATH_SCHEMA_VERSION, $info->schemaVersion, 'Update Craft schema version');
}
Craft::$app->getProjectConfig()->set(
ProjectConfig::PATH_SCHEMA_VERSION,
$info->schemaVersion,
'Update Craft schema version',
);

$this->_isCraftUpdatePending = null;

Expand Down