Copied to clipboard

Flag this post as spam?

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


  • Fabian 23 posts 103 karma points
    Jun 16, 2015 @ 11:18
    Fabian
    0

    ContentService Saving cancel

    Hi,

    in my ApplicationEventHandler I implemented the saving event.

    ...
    ContentService.Saving += ContentService_OnSaving;
    ...
    
    
    private void ContentService_OnSaving(IContentService sender, SaveEventArgs<IContent> e)
    {
        // custome code here...
        e.Cancel = true;
    }
    

    In my custome code I check some values of the node which I want to save and if something is wrong set e.cancel to true.

    Now, on the content page comes the error message and the "Save and Publish" button is disabled!! So the user can't fix the wrong values and click the "Save and Publish" button again.

    Is this a bug? In my eyes the "Save and Publish" button should not be disabled if e.cancel was set to true.

    Any ideas? regards fabian

  • Steven Harland 78 posts 518 karma points c-trib
    Jun 18, 2015 @ 12:49
    Steven Harland
    100

    Hi Fabian,

    Have a look for any errors in the JavaScript console of your browser. I've had the same issue when an exception was thrown in an event handler on the server side. If you're in running in debug you should see the exception in the error response.

  • Fabian 23 posts 103 karma points
    Jun 18, 2015 @ 13:17
    Fabian
    0

    Hi Steven, saw an error in console but seems nothing to do with the event handler but somehow disabled the "Publish and save" button. On a new content page it worked for me.

    Thanks for the hint :)

Please Sign in or register to post replies

Write your reply to:

Draft