Score:0

How to add a confirmation form to an advanced configurable action?

bo flag

So far I successfully implemented an advanced action (in a custom module) by extending ConfigurableActionBase and implementing ContainerFactoryPluginInterface. As expected, it appears listed in /admin/config/system/actions, where new actions can be created and configured. These actions show up in the bulk action drop down menu in /admin/content. Selecting one or more content items and performing the action on them works fine.

Now, since these actions are somewhat consequential, I need to add a confirmation form before executing them.

There don't seem to be any examples on the net, at least not for this particular case. Looking into core modules with similar actions didn't yield enough hints for me to figure this out. ConfirmFormBase and *.routing.yml seem to be unable to deal with bulk actions.

I should maybe note that modules Views Bulk Operations (VBO) and Views Bulk Edit are also installed.

What is the proper way of adding a confirmation form?

cn flag
For an example, user deletion requires confirmation/specification of the deletion method.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.