U4-9490 - ContentService.SendToPublication cannot be called without raising Save events

Created by Claus Jensen 05 Feb 2017, 09:24:25 Updated by Sebastiaan Janssen 04 Sep 2017, 09:33:03

Tags: Backport

If you need to hook into the .Save event of the content service and trigger a send to publication - you will end up in an endless loop due to the .SendToPublication method calling .Save again, while not allowing to set raiseEvents to false.

Comments

Claus Jensen 05 Feb 2017, 09:28:22

PR: https://github.com/umbraco/Umbraco-CMS/pull/1730


Shannon Deminick 06 Feb 2017, 03:44:55

Shouldn't this be the other way around? SendToPublication's only real job is to raise events. In theory it shouldn't actually Save the item it unnecessary, or an overload could have a bool to Save or not to save, but seems odd to have an overload to disable emitting events since that is literally the sole responsibility of this method.


Claus Jensen 07 Feb 2017, 08:09:22

Hmm you're right. Just looked at it again and yep - it wouldn't make sense to not trigger those events. I'll change it to being able to cancel out the Save happening.


Priority: Normal

Type: Bug

State: Open

Assignee: Claus Jensen

Difficulty:

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.5.8

Due in version:

Sprint:

Story Points:

Cycle: