Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Nov 05, 2014 @ 07:36
    Nathan Woulfe
    0

    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...

    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
                });
        });
    
  • Sören Deger 726 posts 2833 karma points c-trib
    Feb 27, 2015 @ 09:00
    Sören Deger
    0

    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

  • Sören Deger 726 posts 2833 karma points c-trib
    Feb 27, 2015 @ 09:37
    Sören Deger
    0

    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

  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Feb 27, 2015 @ 09:58
    Nathan Woulfe
    0

    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.

  • Sören Deger 726 posts 2833 karma points c-trib
    Feb 27, 2015 @ 10:04
    Sören Deger
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies