If you have a multisite Craft installation and you want to work with drafts the behavior when updating an entry from a draft is not what a normal user would expect and could lead to changed content on the entry on a different site.
If you create a draft for an entry this draft will be created for all the sites (If configured) and this is expected. Now you want to use this draft only for the english site. This draft is scheduled to be published in 3 days. In the meantime you fix an error on the german site of the same entry (not via the draft) und save the entry.
After 3 days you will publish the draft from the english site. The english sites draft is published and works perfectly. But what you do not know is that your fix on the german site was overwritten by the german sites draft entry which was not updated by the fix you made on the german entry which is in my opinion a valid and practical workflow.
After you publish the draft your changes on the german sites are overwritten by the state of the german draft
You only want to publish the draft for the english site and not the german site.
Actually it could be quite confusing that a draft will get automatically created for another site.
A typical use case could be a promo action only for the us site and not the german site.
I think this "feature" needs some refinement.
Quick update – this is marked as an enhancement because it is currently working as intended. Drafts in Craft 3.2+ now store content for all sites, as opposed to just the site the draft was created from. When you apply a draft, it is expected that all sites’ content would be updated because each of those sites could contain changes within the draft.
That said it is clearly leading to unexpected consequences, so it’s worth revisiting.
@brandonkelly - Thank you for considering bumping this issue up in priority.
Unfortunately, the way "Drafts" has been designed for Craft 3.2 breaks the basic translation workflow model for any content managers who want to update and manage their Target Entries and Sites on an individual basis.
We will put together some generic professional translation workflow details further explaining the need for a solution to this issue and will share with you soon.
We look forward to discussing this further, but we think one potential option for Craft to fix this issue would be to allow for single Drafts to be updated independently from each other across multi-sites.
Reference 'closed' ticket: https://github.com/craftcms/cms/issues/4811
Reference screencast video: https://imgur.com/8mZ7iBg
@brandonkelly - Do you think it could make sense to add a default $propagate = true
parameter to the createDraft()
method in craft\services\Drafts
that can be switched off directly or via a Section setting if needed?
I see how draft propagation can be useful in certain workflows but compared to previous versions of Craft, I think it can be confusing when a user creates a draft that auto-propagates when expecting it to be site-specific. Thoughts?
Ditto what @ifrimere said.
Am I correct in thinking that content managers in different languages have to work off the same draft or else they run the risk of overwriting each other's content?
I would just like to add more priority to this.
Currently we have an issue regarding multiple languages with drafts. When an editor creates a draft in one language (which automatically happens when you open the preview), and then applies that draft, all the other Languages/Sites are overwritten with the content of that language. Is that an issue that is specific to our setup in the structure? That is really a major issue for us (our customers) and i cannot really see how this can be called working as intended.
When the editor saves the entry without creating a draft, saving only the language works well.
There should be a config option to go between the current functionality (versions and drafts and propagate across sites) and the functionality that sparked the change here: https://github.com/craftcms/cms/issues/2669
I'll also add that switching section settings back to "Only save entries to the site they were created in" shouldn't automatically delete all entries in the other sites as that creates a whole different set of issues.
Unfortunately, the way "Drafts" has been designed for Craft 3.2 breaks the basic translation workflow model for any content managers who want to update and manage their Target Entries and Sites on an individual basis.
Very true. Have been hammering my head on this when a client told us their translations got overwritten every time they modified an entry, apparently after they previewed it first (which automatically creates a draft), only to find out this is default behaviour...
Is there any short-term solution on how this can be avoided? We can't afford having this client lose their translated content every couple of days by just previewing and updating an entry..
I would just like to add more priority to this.
Currently we have an issue regarding multiple languages with drafts. When an editor creates a draft in one language (which automatically happens when you open the preview), and then applies that draft, all the other Languages/Sites are _overwritten_ with the content of that language. Is that an issue that is specific to our setup in the structure? That is really a major issue for us (our customers) and i cannot really see how this can be called working as intended.When the editor saves the entry without creating a draft, saving only the language works well.
@brandonkelly I too believe this needs more priority than an enhancement for a next release. It currently breaks our clients content-editing workflow as they are losing already translated content. Unless there is a way that I'm not aware of right now in that we can change something in our structure / field settings that could prevent this from happening? Thanks a lot for looking into this!
Hmm apparently I now only experience this issue in Neo fields.. Of which I've created an issue here => link
This is now resolved for Craft 3.4!
Change tracking is built on top of delta update support (#5146), so these features will only be available to drafts that were created after updating to Craft 3.4.
To help test, change your craftcms/cms
requirement in composer.json to:
"require": {
"craftcms/cms": "3.4.x-dev",
"...": "..."
}
Then run composer update
.
@christianruhstaller and @ifrimere, did this update resolve your issues? If I understood Christian's initial request, this is still a major unresolved issue if multiple site authors are working on the same entry.
Screenshare example: https://download.hamiltonsupport.com/wl/?id=DNEmxczbYGZA0kIzcf42asHvQ1LLOhtu
This is the dilemma as I understand and experience it:
I guess my question is has anyone figured out an acceptable procedure for their users to work on the same entry and not accidentally publish each others drafts?
@huelabs in the scenario you describe above, the draft changes get applied simultaneously because you are working within the same "EN Draft." Ideally, you should be able to create multiple drafts, merge content updates that have occurred since draft creation, and publish them asynchronously. However, Craft still has issues with merging localized content into drafts, particularly Matrix fields https://github.com/craftcms/cms/issues/5503, so that may not be a viable option.
... did this update resolve your issues?
If you're referring to the https://github.com/AcclaroInc/craft-translations plugin, we have a solution to support asynchronous draft publishing while avoiding the content overwrite issues. As long your "nested" block types (i.e., Matrix, SuperTable, Neo, etc.) are localized (stored on a per-site/language) basis, you can publish drafts created through the plugin on a per-site/language basis without content getting reverted or overwritten.
I believe we still have some serious issues when creating multiple drafts by multiple authors. I could be totally off here, but any clarification would be super useful. Here's a new screen share with 3 scenarios: https://download.hamiltonsupport.com/wl/?id=nWwwOiTDNwiwWH8OreZ5NUvloahfpQ8N
@huelabs - scenarios 2 & 3 are a tough challenge to watch in your shared video b/c putting myself in the shoes of a content manager, source content should never unexpectedly revert to a previous version just b/c target content changes in any way. But maybe there's something in the Craft internal loc workflow I'm not aware of.
@sidedwards - do you have any recommendations for @huelabs to better enable simultaneous content (not structure) updates to source/target entries whereby the source entry won't get changed in an undesirable way?
Most helpful comment
This is now resolved for Craft 3.4!
Change tracking is built on top of delta update support (#5146), so these features will only be available to drafts that were created after updating to Craft 3.4.
To help test, change your
craftcms/cms
requirement in composer.json to:Then run
composer update
.