[4.x]: Drafted Versions Failing to Apply with New Sites Added
What happened?
Description
A client tried to apply some drafts that they had accidentally added a new site to, then disabled. The new (disabled) sites on the drafted version were preventing the draft from applying due to the site not existing on the published entry.
Steps to reproduce
- Create an entry on 1 site (Site A)
- Create a draft of that entry and add to second site (Site B) but disable on Site B
- Attempt to apply the draft
Expected behavior
Draft applies. I could see this adding the entry to Site B in a disabled state.
Actual behavior
Draft throws internal server error (UnsupportedSiteException)
My current solve for this was to add the sites to the published version in a disabled state and then apply the draft. There's also no way of "Deleting Draft for Site" similar to "Delete Entry for Site". I could see just an X in the "Status" Field of drafts to delete for that site as a solution.
Craft CMS version
Craft Pro 4.4.17
PHP version
8.1.17
Operating system and version
Linux 5.4.0-144-generic
Database type and version
MySQL 8.0.26
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.10-23)
Installed plugins and versions
| Plugin | Version |
|---|---|
| Colorit | 4.0.0 |
| Control Panel CSS | 2.6.0 |
| Control Panel JS | 2.6.0 |
| Dashboard Begone | 2.0.0 |
| DigitalOcean Spaces Filesystem | 2.0.0 |
| Documentation | 4.0.0 |
| Feed Me | 5.2.0 |
| Neo | 3.8.6 |
| Netlify Status | v1.1.0 |
| Publisher X | 3.0.1 |
| Redactor | 3.0.4 |
| Redactor Custom Styles | 4.0.3 |
| Super Table | 3.0.9 |
| Webhooks | 3.0.4 |
| Webhook Scheduler | 1.1.0 |
To add a little more clarity:
Here's the published Version and sites active:
Here's the drafted Version and sites added:
Hi, thanks for reaching out. Could you please post the error from the logs?