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

project-config sync/rebuild errors with missing fields #5209

Open
timkelty opened this issue Nov 6, 2019 · 3 comments
Open

project-config sync/rebuild errors with missing fields #5209

timkelty opened this issue Nov 6, 2019 · 3 comments

Comments

@timkelty
Copy link
Contributor

@timkelty timkelty commented Nov 6, 2019

Following a Craft 2 upgrade, I'm able to run craft project-config/rebuild, which succeeds.

There are certain fieldtypes that have no match – they remain in project.yaml, and show red in the CP.

I would assume, that running craft project-config/sync --force immediately following rebuild would always succeed, but in this case it doesn't. I get errors about missing field classes for the fields that no longer have types.

@andris-sevcenko

This comment has been minimized.

Copy link
Member

@andris-sevcenko andris-sevcenko commented Nov 6, 2019

rebuild populates whatever your actual state of Craft is to project config. If you have fields that use classes that are not available to them, I would not expect things to run smoothly. How should Craft proceed about resolving this, then?

@timkelty

This comment has been minimized.

Copy link
Contributor Author

@timkelty timkelty commented Nov 6, 2019

I think a reasonable expectation is that Craft itself will never build an invalid config. In this case that's what's happening, as the config it generates cannot be sync'd.

Not sure the best approach, but Craft could simple skip over fields that had missing classes, rather than halting on exception.

@andris-sevcenko

This comment has been minimized.

Copy link
Member

@andris-sevcenko andris-sevcenko commented Nov 6, 2019

Well, project config rebuild operation essentially re-runs the migration that creates the initial project config, so you could argue that the config after upgrading isn't syncable.

As this scenario seems pretty fringe and unlikely to occur during normal operation, if I was upgrading a site, I would prefer it breaking with a screaming exception rather than just silently ignoring the errors. Furthermore, if something in the project config gets glossed over, it still gets imported into the internal project config, meaning that you would have to use --force option next time to try to sync it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.