Can anyone help as to why the below code isn't working? I'm trying to update and republish a node from a property editor - I think I need to rebind the changed properties, but can't work out how...
contentResource.getById(id)
.then(function (node) {
console.log(node); // yup, it's a content node
var props = contentEditingHelper.getAllProps(node),
prop = $filter('getByAliasValue')(props, 'mainImage');
prop.value = 100; //an image id
contentResource.publish(node, false)
.then(function (resp) {
alert('published');
console.log(node); // still a content node, property has changed, but published item doesn't reflect same
});
});
To be honest, I can't even remember what I was trying to achieve - I had started playing around with creating a media manager type package, to show which nodes a media item was used on, but dropped it for a something else. I'll have a look back through the logs and see if I can find anything interesting.
all good. If you have anytime an issue with a custom property editor, first you should have a look in the browser console. Mostly this already explained everything.
Editing and republishing via ContentResource
Can anyone help as to why the below code isn't working? I'm trying to update and republish a node from a property editor - I think I need to rebind the changed properties, but can't work out how...
Hi Nathan,
have you been able to solve the problem yet? I have a similar issue here:
https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/61699-contentResourceSave-throw-404-Not-Found-Error
Best,
Sören
Hi Nathan,
can you find any errors in your browser console and in the umbraco log file? This allows us to limit the error.
Best,
Sören
Hi Soren
To be honest, I can't even remember what I was trying to achieve - I had started playing around with creating a media manager type package, to show which nodes a media item was used on, but dropped it for a something else. I'll have a look back through the logs and see if I can find anything interesting.
Hi Nathan,
all good. If you have anytime an issue with a custom property editor, first you should have a look in the browser console. Mostly this already explained everything.
Best,
Sören
is working on a reply...