I would rather have some kind of data attribute that can be set on the button itself. In general, having "confirmable" actions handled at core level would be great, but that's another topic...
This way, the button can provide the message itself or even make it user configurable if needed. Much better than hardcoded in js.
Toasts message should rely on X-Status instead
Additional Context
No response
Validations
[X] Check that there isn't already an issue that reports the same bug
[X] Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
Thanks for reporting this.
If you'd like to raise a PR to resolve this I'd be very grateful. This almost certainly affects CMS 4 as well, so please target 1.13 if you do open a PR to resolve this.
Module version(s) affected
5.1.x
Description
Currently, when you unlink a record, you get a warning message saying "Are you sure you want to delete this record?"
This is obviously NOT the case since you only UNLINK the record.
The toast message says "deleted" afterwards
How to reproduce
In model admin Have a record with a has_many relation Unlink a record Get the message and see the toast
Possible Solution
This seems to be done on the js side of things
https://github.com/silverstripe/silverstripe-admin/blob/0c5de61469e6ae732f50a04264fc776f93fdc40a/client/src/legacy/GridField.js#L562-L564
I would rather have some kind of data attribute that can be set on the button itself. In general, having "confirmable" actions handled at core level would be great, but that's another topic...
This way, the button can provide the message itself or even make it user configurable if needed. Much better than hardcoded in js.
Toasts message should rely on X-Status instead
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)