-
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
[5.x]: Some singles are duplicated when the underlying entry type is merged #16087
Comments
Any chance you can share your Craft 4 database, as well as your Craft 5 Composer files, so we can try to reproduce on our end? If so please send them to [email protected]. |
@brandonkelly Done! Let me know if you need any other information or files. |
Nevermind, we’ve been able to reproduce. We’ll look into it. |
Craft 5.5.1 is out with a fix for this. Thanks for reporting! |
@brandonkelly Thanks for fixing this! I got one production site where the duplication glitch already happened, could you advise me on the best way to delete the superfluous single entries? Probably going to remove those from the database manually? I'm worried about leaving junk or accidentally deleting something that belongs to the existing singles … |
You could switch the section to a Channel, deploy, delete the extra entry, and then switch it back to a Single. |
@brandonkelly Good idea, thanks! I ended up cheating a bit – switched the production environment to dev mode for a minute, changed the sections to channels, deleted the additional entries, then reset and applied the config again. Worked like a charm 🙂 |
What happened?
Description
We updated one of our sites from Craft 4 to Craft 5. After the update, we merged some redundant entry types. After deploying the change with those merges, we ended up with duplicates of some of the single entries:
The sections
404 Seite
,Datenschutz
andImpressum
are all singles. In Craft 4, those all had their own entry type with identical settings. In Craft 5, we merged those three entry types into a genericpage
entry type.I'm pretty confident the entry type merge is responsible, since all other singles that didn't have their entry type merged weren't duplicated. So it looks like there's a bug that causes Craft to create a new entry type in a single section when the entry types that's used in this section is merged with another one. This issue only happened when merging the update into production, not in the local dev environment.
In addition to fixing this behaviour, I need some guidance on how to clean up those duplicated entries. I can't delete them through the CP since that's not possible for singles. I'll need to nuke those entries directly in the DB, but I'm worried I will leave behind a broken state.
Steps to reproduce
See above.
Expected behavior
There should never be more than one entry associated with a section. Merging the entry type used in a single should not cause the single to be duplicated.
Actual behavior
Upon deploying the changes that contain the merged entry types, an additional entry was created for each single whose entry type was merged. Now we have two redundant entries both associated with the same single.
Craft CMS version
5.4.10
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
The text was updated successfully, but these errors were encountered: