Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Craft 3.1.4 - issue with getAreConfigSchemaVersionsCompatible() method (works fine on 3.1.3) #3713

Closed
i-just opened this issue Jan 25, 2019 · 5 comments
Assignees

Comments

@i-just
Copy link
Contributor

i-just commented Jan 25, 2019

Description

Since updating from Craft 3.1.3 to Craft 3.1.4 I started having issues with the project config. After making just a single, simple update in settings and pushing updated project.yaml to the next env I started getting:

Your project.yaml file was created for different versions of Craft and/or plugins than what’s currently installed.

Try running composer install from your terminal to resolve.

Downgraded to 3.1.3 and the same changes went through as expected.

Steps to reproduce

  1. Make update in dev env; project.yaml gets updated correctly
  2. Push changes to uat (mainly project.yaml, composer.lock)
  3. Run composer install (just to make sure all is the same)
  4. Go do /admin
  5. Error message about different versions of Craft/plugins displayed (see above)

Applying the same steps on when on Craft 3.1.3 produces correct results (project config changes are applied without any problems).

Additional info

  • Craft version: 3.1.4
  • PHP version: 7.1.23
  • Database driver & version: MySQL 5.5.5

Potentially narrowed the issue down to this commit: b785163 (changes to services/ProjectConfig => getAreConfigSchemaVersionsCompatible() method.

@andris-sevcenko
Copy link
Contributor

That change was made to prevent issues in the future. What are the Craft versions on both of your environments? To migrate using the project.yaml file, Craft now requires that both of your environments are on the same DB schema versions for Craft and all of the plugins to avoid unpredictable behavior when codebase might not be what the migrations and project config expects.

If you believe that this is the case, can you send over both of your project.yaml files (source and target) to [email protected]?

@andris-sevcenko andris-sevcenko self-assigned this Jan 25, 2019
@i-just
Copy link
Contributor Author

i-just commented Jan 25, 2019

Thanks for getting back to me. I have sent an email to [email protected] as I'm lost as to why the same types of changes work for me on 3.1.3 but not 3.1.4.

@dustinwalker
Copy link

dustinwalker commented Jan 25, 2019

I'm running into the same issue. Both environments are on Craft 3.1.4 and using the same composer.lock file. It appears the difference is the sort order number being generated in quotes locally vs. live not creating it that way.

example:
screenshot_374

@sam-1-2
Copy link

sam-1-2 commented Jan 25, 2019

We are seeing exactly the same issue.

Worked around by adding a ! before version_compare to lines 668 and 680 in services/ProjectConfig => getAreConfigSchemaVersionsCompatible() method.

if (!version_compare($existingSchema, $incomingSchema, '=')) {

http://php.net/manual/en/function.version-compare.php

When using the optional operator argument, the function will return TRUE if the relationship is the one specified by the operator, FALSE otherwise.

@andris-sevcenko
Copy link
Contributor

Ugh, software is hard. Sorry about that. I've talked with my yesterday self and he promised never to make stupid mistakes again.

A release should be out soon, but feel free to edit your composer.json file to pull in these changes immediately by requiring Craft like this:

"craftcms/cms": "dev-develop#0aaf1edcbedbbc702c1e483366f61c038f577a82 as 3.1.4"

and running composer update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants