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

[4.x]: Prune revisions with Matrix destroys entries #11285

Closed
vandres opened this issue May 20, 2022 · 4 comments
Closed

[4.x]: Prune revisions with Matrix destroys entries #11285

vandres opened this issue May 20, 2022 · 4 comments

Comments

@vandres
Copy link
Contributor

vandres commented May 20, 2022

What happened?

Description

When having Matrix blocks, upon calling utils/prune-revisions, the Matrix blocks get destroyed

Steps to reproduce

  1. Setup Craft 4
  2. Create a Matrix block and assign it to a section
  3. Don't know if it is relevant, but it's a multi site setup
  4. Create some content in that section entry
  5. Call utils/prune-revisions with 0
  6. Try to save the entry again

I've setup a repo to display the issue https://github.com/vandres/craft4-prune-revisions-matrix

In the sql folder, you have a db dump before and after the prune.

Bildschirmfoto 2022-05-20 um 09 12 23

Bildschirmfoto 2022-05-20 um 09 12 33

Expected behavior

All but 1 revisions are gone. It should be still possible to save new revisions.

Actual behavior

Saving entries after the prune is no longer possible.

Craft CMS version

4.0.2

PHP version

8.0

Operating system and version

Debian 11

Database type and version

MariaDB 10.3

Image driver and version

No response

Installed plugins and versions

None - blank default setup

@brandonkelly
Copy link
Member

This is the same underlying issue as #11155, which has been fixed for the next release (imminent).

@brandonkelly
Copy link
Member

Craft 4.0.3 is out now with that fix.

@vandres
Copy link
Contributor Author

vandres commented May 20, 2022 via email

@brandonkelly
Copy link
Member

There was nothing to fix, actually. utils/prune-revisions just doesn’t completely erase the revision data (which is sortof a bug, but something that garbage collection will take care of so not a big deal), but the partial remaining revision data was confusing a part of Craft’s revision creation process into thinking a revision existed when it didn’t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants