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
Integrity constraint violation with Project Config #90
Comments
Running into this too, Craft CMS 3.4.9 and Spoon 3.5.2. The matrixBlockType in question is new, defined in |
Should probably do a check similar to: https://github.com/craftcms/cms/blob/develop/src/services/Matrix.php#L325 |
@qrazi you hero, thanks for finding that! If you want to PR it that would be a big help. |
@joshangell I am still testing / investigating on my end, but I'll try and isolate this bug and do a PR (the issues on my end include more things than just this one... 😬 ) |
@qrazi aaaah sorry about that, there are an increasing number of edge case bugs popping up that are frustratingly time consuming to fix! |
@joshangell No worries! I mean in the project I am working, not specifically this plugin 😅 |
Ok, things are up running on my environment again, and right now I do not need the check similar to the Matrix-service. The other issues I kept running into when syncing the I am still not a 100% why that ended up in Spoon trying to insert a record before the accompanying MatrixBlockField was inserted, but probably because when searching based on handle it would have given a result somewhere. The Craft CMS ecosystem uses both handles and uids. Not that long ago this used to be solely based on handles, so duplicating handles was actually a lot more difficult. We're now in this mixed code that on the one hand allows create duplicate handles, but on the other hand always expects a handle to be unique. I am not sure if the cause is similar for @engram-design error? I will create a PR anyway, but I think it might solve a symptom, not a cause. |
So, I believe what happened at the time, was the Matrix blocks themselves didn't update, or something went wrong, and due to that, Spoon tried to do its thing without having the Matrix blocks properly sorted first. It's all a bit vague, but it was pretty urgent to fix at the time, so had to revert things, and manually set things up from scratch. |
Yes, we've been doing that a lot too. It's really easy to get these kind of issues in Craft CMS. Development discipline remains key. However, the PR would point developers a bit more in the right direction I think. |
Was there any sort of resolution to this problem? I'm seeing the same thing happen that it's trying to sync the spoon config before the matrix block types exist. |
I am running into this too. @engram-design Have you checked PR #93? |
? |
@dennisfrank Haven't tried the PR - did it work for you? |
Just ran into this myself - any word? |
We've started to switch some projects over to https://plugins.craftcms.com/matrixmate since there hasn't been much action here. Just in case that could be helpful to anyone. |
I can finally reproduce this! Will be aiming to fix asap. |
OK - seems like the PR #93 fixes this - have tested against my reproducible case an it fixes that, though I’m not going to rule out it not fixing other situations so please do re-open this if that is the case. |
- Fixed an issue where project config could fail with an "Integrity constraint violation" error - thanks to [@qrazi](https://github.com/qrazi) for pointing me in the right direction! ([#90](#90) & [PR #93](#93)) - Fixed an issue with newer versions of Super Table which caused Matrix blocks to render empty if there was at least one Super Table configured inside the Matrix field ([#98](#98)) - Fixed an error that could occur when matrix fields don’t return properly by ID ([#92](#92))
Had the following issue after editing blocks locally, and pushing to production.
This also left 10 out of 13 block types 'reset' so I had to set them up through Spoon again.
The text was updated successfully, but these errors were encountered: