[ ] Regression (a behavior that stopped working in a new release)
[X] Bug report
[ ] Performance issue
[ ] Documentation issue or request
Current behavior
I am not able to delete the content using the delete button in ui, it is giving a validation error pop up message. This is usually happens when you have delete script for schema, so if you dont have delete script for schema and then delete functionality is working fine.
Expected behavior
Delete functionality should work with or without delete script.
I just looked into it again, yes we are prevening the deletion through reject function. We used to show the message in ui to user, why we have restricted him/her to delete the content, by adding custom message as argument in reject function.
e.g. reject(‘you are not allowed’);
However currently, it doesnt show the custom message just show validation error in popup.
I have verified the issue and below is my finding:
if the content is not being referred to in other schema and there is a delete script exist for restricting the user. e.g. reject(‘not allowed’);
earlier behavior: red popup with message ‘not allowed’
current behavior after the fix: popup with message ‘validation error: not allowed’
I am fine with this change, it’s just having validation error as extra.
if the content is being referred to in another schema and there is a delete script exists for restricting the user. e.g. reject(‘not allowed’);
earlier behavior: red popup with message ‘not allowed’
current behavior after the fix: popup with message ‘content is referenced by another schema and cannot be deleted’.
The delete script is not executed, but we want the script to be executed first. is it possible to execute the delete script first and then if it is passed the script execution then verify the reference?