craftcms / craftcms/cms

[4.x]: Craft cant prune matrix block revisions

Open
#15,843 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

We had a problem with a Craft 5 Update and started researching. Right now we found out that downgraded back to Craft 4.12.5. We are not able to clean all revisions from the DB.

Steps to reproduce
  1. ./craft utils/prune-revisions --max-revisions=0
Expected behavior

All revisions all cleaned / or marked to delete for the 'garbage collector'

Actual behavior

Image

Craft CMS version

4.12.5

PHP version

8.2

Operating system and version

No response

Database type and version

MySQL 8.0.32

Image driver and version

GD 8.2.24

Installed plugins and versions
  • ckeditor
  • Fix-Fks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ./craft utils/prune-revisions --max-revisions=0 entry point using Craft 4.12.5 and MySQL 8.0.32, then trace how matrix block revisions are selected and removed or marked for garbage collection. Done means the command processes all revisions without leaving the reported matrix block records behind.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.