Download the PHP package confirm-actions/magento2-confirm-actions without Composer
On this page you can find all versions of the php package confirm-actions/magento2-confirm-actions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download confirm-actions/magento2-confirm-actions
More information about confirm-actions/magento2-confirm-actions
Files in confirm-actions/magento2-confirm-actions
Package magento2-confirm-actions
Short Description Magento 2 and Adobe Commerce admin safety module with double and typed confirmation for mass-delete actions.
License MIT
Homepage https://github.com/will-wright1/magento2-confirm-actions
Informations about the package magento2-confirm-actions
Magento 2 / Adobe Commerce mass-delete confirmation
Prevent accidental deletion of products and other records in Magento Admin. This lightweight Magento 2 and Adobe Commerce module adds a second confirmation to mass-delete actions and requires typed confirmation for large deletions.
Magento's normal confirmation dialog remains the first step. After the administrator clicks OK, this module displays a separate final warning before Magento can send the delete request. It protects standard and tree-style mass-action menus across the Admin, including the product grid.
What it protects against
- Accidentally confirming Magento's ordinary mass-delete dialog
- Deleting a large explicit selection without verifying the record count
- Using Select All and unintentionally deleting every matching record
- Custom destructive actions that opt in to the same protection
Confirmation behaviour
| Selection | First step | Additional module step |
|---|---|---|
| 1–20 explicitly selected records | Magento's normal confirmation | Final irreversible-deletion warning |
| More than 20 explicitly selected records | Magento's normal confirmation | Type the exact phrase, such as DELETE 25 |
| Select All | Magento's normal confirmation | Type DELETE <count> for all matching records |
The Delete permanently button remains disabled until the typed phrase matches exactly. The default threshold is 20 records and can be configured per action.
Requirements
- Magento Open Source or Adobe Commerce 2.4
- PHP 7.4 or PHP 8.1–8.4, subject to the Magento version's PHP support
Installation
Install the package through Composer, then enable it:
In production mode, redeploy Admin static content after installation:
Updating
Redeploy Admin static content after updating a production-mode installation.
What administrators will see
The first dialog still looks like Magento's normal Delete items dialog. That is intentional: the module preserves confirmations supplied by Magento or another extension. Click OK on that first dialog to reach the additional module confirmation.
For a small deletion, the second dialog is titled Final deletion
confirmation. For a large or Select All deletion, it is titled Type to
confirm deletion and requires a phrase such as DELETE 25.
Troubleshooting
If the additional confirmation does not appear after accepting Magento's first dialog:
-
Confirm the module is enabled:
-
Clear Magento caches and redeploy static content:
-
Refresh the Admin page without using the browser cache.
- Check that the action is recognized as a delete action. Custom destructive
actions with another name can opt in using
confirmDeleteas shown below.
Custom mass actions
The module protects actions where delete appears as a word in the action's
type, label, or url. Camel-case identifiers such as massDelete are
supported. The default Magento confirmation is used whenever one is already
present.
The typed-confirmation threshold defaults to 20 and can be overridden for a
custom action in its data/config argument:
For a custom action whose configuration does not contain the word delete, add
an explicit flag to its mass-action configuration. Custom settings belong in
the action's data/config argument so Magento's UI component XML remains valid:
The confirmation is a browser-side safety guard. Magento's normal ACL and form key protections remain responsible for authorising the delete request.
Scope and limitations
- The module protects Admin UI mass actions; it does not intercept deletes made through REST, GraphQL, imports, the command line, or direct database access.
- It recognizes
deleteas a word in the action's type, label, or URL, including camel-case identifiers such asmassDelete. - It does not replace Magento authorization, form-key validation, backups, or appropriate Admin permissions.
Support
Report bugs or request enhancements through GitHub Issues. When reporting an Admin UI issue, include the Magento version, browser, action being protected, and whether production mode is enabled.
Development
Run the dependency-free JavaScript tests with Node.js 18 or later:
License
Released under the MIT License.