U4-5398 - CreateContent SaveAndPublish does not behave like CMS UI

Created by Lee Cichanowicz 25 Aug 2014, 19:21:19 Updated by Shannon Deminick 26 Jun 2017, 05:40:42

Using the ContentService, programmatic creation of a node, which contains an inherited (from Base doc type) property of type 'True/false' that is 'Mandatory', will fail to publish (if the property is not explicitly set), because the inherited True/false property is invalid due to not defaulting to 'false' as the back office UI would do for a content manager. This seems like inconsistent behavior between the API and the back office.

Steps to reproduce:

  1. Create the node programmatically (of a doc type that inherits a mandatory True/false property), without explicitly setting the true/false property value
  2. Publish it programmatically
  3. Navigate to the new node in the back office
  4. It is unpublished and the log states: INFO Umbraco.Core.Services.ContentService - [Thread 41] Content 'My Node Name' with Id '0' could not be published because of invalid properties.
  5. Click the 'Save and publish' button in the back office node UI, and it publishes successfully.

Thanks to the SaveAndPublish deprecation message ('Use SaveAndPublishWithStatus instead, that method will provide more detailed information on the outcome'), I used the SaveAndPublishWithStatus method and got the Attempt.Result.InvalidProperties info to figure out why it would publish via the back office but not the ConentService API.


Shannon Deminick 26 Jun 2017, 05:40:43

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/

Priority: Normal

Type: Bug

State: Closed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.1.4

Due in version:


Story Points: