[META][D8][UX] Convert all confirmation pages to confirmation dialogs instead.
I had filed a couple of separate issues for this back in 2015, about specific pages. Let's make this issue here a meta to list all such issues.
First step would be:
- [ ] #3771 | [UX] Introduce a
confirm_dialog()function (and use that one instead ofconfirm_form())
Specific confirmation pages to be converted to dialogs:
- [ ] #769 | [UX] Move the confirmation dialog for deletion of nodes to a modal.
- [ ] #770 | [UX] Move the confirmation dialog for deletion of menu links to a modal.
- [ ] #3770 | [UX] Move the confirmation dialog for enabling/uninstalling modules to a modal.
Related D8 issues:
- Add abstracted dialog to core (resolves accessibility bug)
- [META] Convert all confirm forms already converted to new routing system to use modal dialog
Related D7 issues:
- Ajax Popups in Drupal 7: Adding Modal Dialogs to Help, Confirmations and Filter tips (Unified)
- Popbox (Popups Lite): Adding Modal Dialogs to Confirmations
(Triaged as possible accessibility issue on 08/17/2921. This one may or many not qualify, please add the [A11Y] tag if you think it qualifies.)
@BWPanda in https://github.com/backdrop/backdrop-issues/issues/1032#issuecomment-593799155 mentioned https://mdbootstrap.com/docs/jquery/modals/forms ...seems neat.
Just a note that a confirm_dialog function wouldn't help. The confirm_form() function actually renders the confirm form itself so if youre using that function, youre already on the confirm form page, too late for a modal.
We'd need to go through all the links and buttons which lead to a confirm form page, and add the data-dialog / use-ajax attributes to them.
This would be a manual one by one thing for the 47 calls in core though.
Indeed, we wouldn't need a confirm_dialog form to convert all confirmation pages to dialogs instead. I just made a few changes to some links as @docwilmot said, and it's working fine. I'm willing to make this manual change if you find it useful. I definitely think it's an improvement.
And then the need to manually update all contrib?
It will not be a need, though. confirm_form will still work as usual.
This would be a manual one by one thing for the 47 calls in core though.
@docwilmot, what search do you do to find those 47 calls? Looking for $links['delete']gives me 22 results. Searching for return confirm_formgives me 41 results. How did you get with those 47 calls?
I would like to give this other approach a try. Should I open a new issue for it?