-
Notifications
You must be signed in to change notification settings - Fork 638
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
[4.x]: Revisions for Matrix fields can't be pruned, causing GC issues #16373
Comments
Hi, thanks for getting in touch!
That’s expected behaviour; it works this way so that if you revert to a revision that had a matrix block, that block is brought back, too.
When you run the If you run the |
Thanks for confirming @i-just!
Only that's not happening... I prune all revisions, run This was set up by someone else as a supportable field with different matrix fields inside it - may that structure is what is causing the issue? |
Huh, any chance you could share your |
Sure, they're on their way :) |
@janhenckens Do you have recursively-nested Matrix fields? If so, it might require running |
Resolved in support. Ended up being due to missing foreign keys in the database. |
Foreign keys were missing because of the export I made, but they are present in the database - still looking for solution for this... |
Thanks for sending over a new db backup! I tracked it down to the fact that the Matrix blocks you mentioned are nested inside a Super Table field and the Super Table blocks are not cleared out via |
What happened?
Description
I'm troubleshooting a database that has grown is size quicker then we had expected and I fell down a bit of a rabbit hole...
We have couple of sections that received content from an API every night, when we overwrite everything that was already present with new data.
This includes a couple of matrix fields, which get deleted very night (since launching we've convinced them to only send updates, which reduces the update frequency) and those elements aren't cleared out when garbage collection runs.
Looking at the code, I found that block-type elements don't get cleaned up if they have revisions.
Pruning all revisions (
php craft utils/prune-revisions/index
and setting them to 0) doesn't seem to clear out revisions for matrix blocks as after running the above command still leaves 2 revisions for a matrix block.So I'm not sure how to proceed in getting this cleaned up, and I'm not sure if this is a bug or not...
Thanks
Craft CMS version
4.12.6.1
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: