From d7a8e7a2e7a5e056b811367bb9fb2ca67c484947 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 18 Jan 2019 11:27:01 -0800 Subject: [PATCH] Don't freak out if a plugin is missing its schema version --- CHANGELOG-v3.md | 1 + src/migrations/Install.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index a67aaa389ec..c11a6d8568a 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -13,6 +13,7 @@ - The installer now checks `project.yaml` when determining the default site name, handle, base URL, and language values. ([#3661](https://github.com/craftcms/cms/issues/3661)) - The Base URL field in the web-based installer now autouggests environment variable names and aliases. - Craft now creates a `.gitignore` file in the `storage/config-backups/` folder, preventing any other files within it from getting tracked by Git. +- Craft no longer prevents changes in `project.yaml` from being synced if a plugins’ schema version in `project.yaml` doesn’t match up with its installed schema version, if one of them is blank. ### Fixed - Fixed a PHP notice that occurred when updating to Craft 3.1 if there were any plugins installed without settings. diff --git a/src/migrations/Install.php b/src/migrations/Install.php index 40d4772f7ab..1a67597c0f9 100644 --- a/src/migrations/Install.php +++ b/src/migrations/Install.php @@ -1090,7 +1090,7 @@ private function _installPlugins() $expectedSchemaVersion = $projectConfig->get(Plugins::CONFIG_PLUGINS_KEY . '.' . $handle . '.schemaVersion', true); /** @var Plugin|null $plugin */ - if ($plugin->schemaVersion != $expectedSchemaVersion) { + if ($plugin->schemaVersion && $expectedSchemaVersion && $plugin->schemaVersion != $expectedSchemaVersion) { throw new InvalidPluginException($handle, "{$handle} is installed at the wrong schema version ({$plugin->schemaVersion}, but project.yaml lists {$expectedSchemaVersion})."); } }