Cancelling ContentService Saving Event ('Received an error from the server')
Using 'e.CancelOperation' in ContentService.Saving event handler gives rise to 'Object reference not set to an instance of an object.' error : the save operation is actually cancelled but the backend is redirected to '/umbraco/#/content/content/edit/0' generating the error.
(Not ideal but I found that setting the id of the cancelled item to that of its parent prior to cancelling the event prevents the error.)
Not really a 'fix' but a workaround: in the event handler, setting the id of the cancelled entity to that of its parent prior to cancelling the event prevents the error. (Only required where the HasIdentity property is false.)
Cancelling ContentService Saving Event ('Received an error from the server')
Using 'e.CancelOperation' in ContentService.Saving event handler gives rise to 'Object reference not set to an instance of an object.' error : the save operation is actually cancelled but the backend is redirected to '/umbraco/#/content/content/edit/0' generating the error.
(Not ideal but I found that setting the id of the cancelled item to that of its parent prior to cancelling the event prevents the error.)
(7.4.2)
Hi Angus,
Did you find fix for this?? I'm facing the same issue...
/ulrich
Hi Ulrich,
Not really a 'fix' but a workaround: in the event handler, setting the id of the cancelled entity to that of its parent prior to cancelling the event prevents the error. (Only required where the HasIdentity property is false.)
/Angus
is working on a reply...