cms icon indicating copy to clipboard operation
cms copied to clipboard

[4.x]: Drafted Versions Failing to Apply with New Sites Added

Open sjstark opened this issue 2 years ago • 2 comments

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

  1. Create an entry on 1 site (Site A)
  2. Create a draft of that entry and add to second site (Site B) but disable on Site B
  3. 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

sjstark avatar Aug 15 '23 19:08 sjstark

To add a little more clarity:

Here's the published Version and sites active: Screen Shot 2023-08-15 at 1 15 29 PM

Here's the drafted Version and sites added: Screen Shot 2023-08-15 at 1 15 18 PM

sjstark avatar Aug 15 '23 19:08 sjstark

Hi, thanks for reaching out. Could you please post the error from the logs?

i-just avatar Aug 16 '23 06:08 i-just