Saving content through ContentService wipes custom Property Editor JSON values in umbraco.config cache
I have a console app that uses ContentService to save content programatically, but it seems to wipe the model value for custom Property Editors that have a JSON valueType.
What this means is that when the umbraco.config cache is rebuilt after my console app runs all property values that would have been saved with a JSON value (if the content was saved via the backoffice) is actually saved with no value, even if no changes are made to any property values on the content at all before saving.
What is strange is that the JSON is still available and stored in the database, it just appears that ContentService.Save() fails to recognise that the Property Editor is actually a custom one and does not fetch the actual value from the database. Saving the content through the backoffice will repopulate the property value in umbraco.config to the currently stored value in the database.
I'm not sure what part of my code I can show to help get around this problem. My package.manifest is set up like so:
{
propertyEditors: [
{
alias: "MediaWithLinkAndTextstring",
name: "Media with Link and Textstring",
editor: {
view: "~/App_Plugins/Partial_MediaWithLinkAndTextstring/partialMediaWithLinkAndTextstring.html",
valueType: "JSON"
}
}
],
javascript: [
"~/App_Plugins/Partial_MediaWithLinkAndTextstring/partialMediaWithLinkAndTextstring.controller.js"
],
css: [
"~/App_Plugins/Partial_MediaWithLinkAndTextstring/partialMediaWithLinkAndTextstring.css"
]
}
Has anyone run into something similar? This is not ideal as it means every time a content page is updated programatically someone will need to manually load up the content in the backoffice and save it from there.
Saving content through ContentService wipes custom Property Editor JSON values in umbraco.config cache
I have a console app that uses
ContentService
to save content programatically, but it seems to wipe the model value for custom Property Editors that have a JSONvalueType
.What this means is that when the
umbraco.config
cache is rebuilt after my console app runs all property values that would have been saved with a JSON value (if the content was saved via the backoffice) is actually saved with no value, even if no changes are made to any property values on the content at all before saving.What is strange is that the JSON is still available and stored in the database, it just appears that
ContentService.Save()
fails to recognise that the Property Editor is actually a custom one and does not fetch the actual value from the database. Saving the content through the backoffice will repopulate the property value inumbraco.config
to the currently stored value in the database.I'm not sure what part of my code I can show to help get around this problem. My
package.manifest
is set up like so:Has anyone run into something similar? This is not ideal as it means every time a content page is updated programatically someone will need to manually load up the content in the backoffice and save it from there.
is working on a reply...