-
Notifications
You must be signed in to change notification settings - Fork 641
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
Syncing project.yaml fails when you change a field from matrix to something else #4015
Comments
Sorry for the oversight on the exception stack trace. Logging it as expected when encountering errors now. As far as the original issue - we're discussing internally on the resolution for this, as it can go two ways: Once we decide (probably today), I'll fix the rest of this issue. |
I think it would be a good idea to have it behave the same way it does when you change the fields in the CMS by hand. |
Right, the thing is that currently having a Matrix field to something else leaves the block types still existing in the database and the project config. So if you make changes to a block type, then change the matrix field to something else and push that project.yaml file, Project Config would react to block type changes and fail to find the matrix field. We're trying to figure out if this is the "correct" behavior and we should make that part of the code more defensive to be OK with the parent field missing or if this in itself is a bug that the block types and everything else is not deleted when the field type changes. |
@andris-sevcenko Think I just ran into this... I converted a Matrix field into a Table field and I'm seeing this error:
|
Description
We had a field that was originally a Matrix field and changed it to type craft\fields\RadioButtons. Changing it locally worked but when you then sync the project.yaml against an environment that still has the matrix field in it it breaks.
This line: https://github.com/craftcms/cms/blob/develop/src/services/Matrix.php#L341
causes the problem because it assumes the field it fetches is a Matrix field (in our case a RadioButton was returned).
"Applying changes from project.yaml ... error: Getting unknown property: craft\fields\RadioButtons::contentTable"
Another problem is that there is no Stacktrace when something goes wrong because this piece of code just throw the exception information away: https://github.com/craftcms/cms/blob/develop/src/console/controllers/ProjectConfigController.php#L65
Why? Could you at least log the exception stacktrace please? I had to go in the code and manually get the trace.
Additional info
Advanced Url Field | 1.0.0
Migration Manager | 3.0.19
Neo | 2.2.5
Redactor | 2.3.2
The text was updated successfully, but these errors were encountered: