[SOLVED] Custom message added to reject function for delete script, showing popup of validation error message in UI, instead of custom message

I’m submitting a…

  • [ ] 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.

Environment

  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [5.6.0]

Browser:

  • [X] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

I am not sure what you meant. If the script has an error or is supposed to prevent deletion, it is supposed to work like that.

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.

Okay, than this is the bug. Can you update the title?

1 Like

Hi Sebastian,

I have verified the issue and below is my finding:

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

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

Yes, I will have a look to the second part.

1 Like

It is in the pipeline: dev-5897

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.