-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uSync Fails to create export file after contentService.SaveAndPublish event #612
Comments
Hi, Are there any custom properties inside the content item you are creating ? . I suspect its not the fact that the item is being created in umbraco forms, but that there is something we are not catching when one (or more) of the properties is being created. i think its this line.,
that gets the value from the GetExportValue method: which in turn is getting it from a sync value mapper. and that value is returning a string when the value is null, so i think the value isn't null, but then a mapper for some reason is returning null, 🤔
|
Looking at the code I suspect this is an edge case where a non-empty but whitespace string is set as the value of something like nested content or blocklist then the mapper code for those values will return null, (when it should return an empty string). that would be a simple fix but if we can confirm the properties on your content node we can test this better. |
Sorry for the delay, just had an hour long phone call. Here's the code that creates and saves(and publishes) the new node.
|
…XCData section with a null value. (#618)
* From v13: Fixes (#590) - missing null check * From v13: Fixes #604. don't prepend path with ~ (for no random reason!) * From v13: Fix #224 - Observe root folder value in rootfolder array if set (and root folders array is not set). (#606) * From v13: Throw for duplicates ( Jumoo/uSync.Complete.Issues#225 ) * Add serializers and handlers for webhooks. (#613) * Add serializers and handlers for webhooks. * Webhook Comments * From v13: Add serializers and handlers for webhooks. (#613) * From v13: Fix #609 Default language importing. (#614) * From v13: Use folders provided in options over config (#610) * From v13: fix #605 - check delete by serializing item one last time. (#616) * From v13: Fix - delete entries show up twice in report and actions. (#617) * From v13: #612 - couple of extra checks so we never try to create an XCData section with a null value. (#618) * Fix for #619. don't report property deletes as changes when they have… (#621) * Fix for #619. don't report property deletes as changes when they have already happened * Add fix for #620 - don't recreate items that are deleted. * v13 - > v14 null checks. * From v13: DataType merging Empty items alway win * update build script * tidy up logging. * consistant JSON options * Add Extra saves for content (not sure we need them! - might be a rc1 issue) * Add Ability to change the editor alias on import * Post RC1 - migration fixes. * chore: project things
* From v13: Fixes (#590) - missing null check * From v13: Fixes #604. don't prepend path with ~ (for no random reason!) * From v13: Fix #224 - Observe root folder value in rootfolder array if set (and root folders array is not set). (#606) * From v13: Throw for duplicates ( Jumoo/uSync.Complete.Issues#225 ) * Add serializers and handlers for webhooks. (#613) * Add serializers and handlers for webhooks. * Webhook Comments * From v13: Add serializers and handlers for webhooks. (#613) * From v13: Fix #609 Default language importing. (#614) * From v13: Use folders provided in options over config (#610) * From v13: fix #605 - check delete by serializing item one last time. (#616) * From v13: Fix - delete entries show up twice in report and actions. (#617) * From v13: #612 - couple of extra checks so we never try to create an XCData section with a null value. (#618) * Fix for #619. don't report property deletes as changes when they have… (#621) * Fix for #619. don't report property deletes as changes when they have already happened * Add fix for #620 - don't recreate items that are deleted. * v13 - > v14 null checks. * From v13: DataType merging Empty items alway win * update build script * tidy up logging. * consistant JSON options * Add Extra saves for content (not sure we need them! - might be a rc1 issue) * Add Ability to change the editor alias on import * Post RC1 - migration fixes. * chore: project things * fixes #629 have a custom Operations handler just for uSync swagger endpoint.
I think this too is fixed in v13.2 of forms. |
Tested, all good, thanks :) |
Describe the bug
In a custom Umbraco Forms workflow, form parameters are used to create a new Umbraco content node via the ContentService.SaveAndPublish(myPage). This happens successfully. On completion of the task there is a Warning from uSync in the terminal:-
[11:41:01 INF] Form Entry Submitted - Form Entry Id: db11390a-ff13-4e0d-8715-6fca2bc6108a, Form Id: 5e589837-7070-4c8c-8c83-86b28df1f129, User:
[11:41:03 INF] Document MyNewPage (id=0) has been published.
[11:41:03 INF] Form Entry Approved - Form Entry Id: db11390a-ff13-4e0d-8715-6fca2bc6108a, Form Id: 5e589837-7070-4c8c-8c83-86b28df1f129, User:
[11:41:03 WRN] Failed to create uSync export file
System.ArgumentNullException: Value cannot be null. (Parameter 'value')
at System.ArgumentNullException.Throw(String paramName)
at System.Xml.Linq.XCData..ctor(String value)
at uSync.Core.Serialization.Serializers.ContentSerializerBase
1.SerializeProperties(TObject item, SyncSerializerOptions options) at uSync.Core.Serialization.Serializers.ContentSerializer.SerializeCore(IContent item, SyncSerializerOptions options) at uSync.Core.Serialization.SyncSerializerRoot
1.Serialize(TObject item, SyncSerializerOptions options)at uSync.BackOffice.SyncHandlers.SyncHandlerRoot
2.SerializeItem(TObject item, SyncSerializerOptions options) at uSync.BackOffice.SyncHandlers.SyncHandlerRoot
2.Export_DoExport(TObject item, String filename, String[] folders, HandlerSettings config)at uSync.BackOffice.SyncHandlers.SyncHandlerRoot
2.Export(TObject item, String[] folders, HandlerSettings config) at uSync.BackOffice.SyncHandlers.SyncHandlerRoot
2.Handle(SavedNotification`1 notification)To Reproduce
Steps to reproduce the behavior:
Create a custom UmbracoForms workflow that creates a new node. Apply it to a form and submit the form.
Expected behavior
No warnings in Terminal on completion
Screenshots
See terminal readout above.
About your Site (please complete the following information):
Additional context
When uSync is removed from the project, the workflow completes without error.
I have the sneakiest suspicion it's something to do with the cache not yet being updated after the SaveAndPublish.
The text was updated successfully, but these errors were encountered: