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

[5.x]: utils/prune-orphaned-entries deletes all entries in some sections #15458

Closed
MoritzLost opened this issue Aug 1, 2024 · 3 comments
Closed
Labels

Comments

@MoritzLost
Copy link
Contributor

MoritzLost commented Aug 1, 2024

What happened?

Description

In trying to debug an issue, I ran utils/prune-orphaned-entries in a local development environment with a copy of the production database. To my surprise, it deleted all entries in some sections. Only sections where the propagation is set to the Save entries to all sites enabled for this section were left untouched. All sections that were set to manual propagation (Let each entry choose…) or no propagation had all entries in all sites deleted.

Not sure how to reproduce this or if it's an issue with my database, but this should never happen.

The issue I'm trying to debug is related to #14348 and #14347. We're still seeing remnants of previous relations sticking around, querying for relations returns elements that were previously related, but were removed from the field. I can't reproduce this fully yet, but something is still not right there. Not sure if it's a database issue that might also cause this problem.

Craft CMS version

5.2.8

PHP version

8.3

Operating system and version

No response

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Yikes, thanks for reporting that! That command was added in 4.7 as utils/prune-orphaned-matrix-blocks (#14154), and I guess I didn’t think to update the element query to exclude top-level entries when adapting it for nested entries in Craft 5.

@MoritzLost
Copy link
Contributor Author

@brandonkelly Thanks for the fix! Good to know this was just an oversight, I was sure my database was somehow messed up 😄

@brandonkelly
Copy link
Member

Craft 5.2.10 is out with that fix. Thanks again!

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

No branches or pull requests

2 participants