[5.x]: When merging entry types, the count includes drafts and revisions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
What happened?
Description
Best I can tell, the entry-types/merge command also includes drafts and revisions when counting entries. For example, I’m seeing:
craft entry-types/merge handle handle2
Which entry type should persist?
- handle (1 usage, 100 entries)
- handle2 (1 usage, 609 entries)
The handle section is 100 newly created entries, with no drafts or revisions, so that is all appearing as expected.
However, handle2 only has 34 entries. After clearing the revisions, the number is way lower, but I’m still not sure why it’s so high.
Steps to reproduce
- Run
craft entry-types/merge handle handle2and see the results - Run
craft utils/prune-revisions --max-revisions=0 - Run
craft entry-types/merge handle handle2again, and see the results are different
Craft CMS version
5.4.1
PHP version
8.2
Operating system and version
No response
Database type and version
PostgreSQL
Image driver and version
No response
Installed plugins and versions
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the entry-types/merge command and compare its entry-count query with the results from utils/prune-revisions --max-revisions=0. Reproduce the discrepancy using the commands and entry counts in the issue, then verify that drafts and revisions no longer inflate the merge prompt's counts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100