[wp-trac] [WordPress Trac] #63005: Replacing certain bulk-edit fields blocks all bulk edits
WordPress Trac
noreply at wordpress.org
Fri Feb 21 22:30:18 UTC 2025
#63005: Replacing certain bulk-edit fields blocks all bulk edits
----------------------------------------+-----------------------------
Reporter: ethitter | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Keywords: has-patch
Focuses: javascript, administration |
----------------------------------------+-----------------------------
In r59134, validation was added to prevent users from submitting bulk
edits if no items are selected, or if no change is chosen for the selected
items. As part of the validation, a specific input name is expected for
the new value. The input name cannot be customized.
If, for example, the "Change role to..." dropdown on the
`WP_Users_List_Table` is removed, validation for all other bulk actions
will fail because the validation requires an input named `new_role`. I
encountered this when replacing the default dropdown with a multi-select
to support Core's ability for users to have multiple roles. I was able to
work around this issue by including a hidden input with the expected name,
but that defeats the validation.
If the input names could be modified, the validation would support custom
input names without requiring extra, unused hidden fields; developers
would also not need to implement their own client-side validation.
Currently, the input names are hardcoded in the validation JS, but they
could be passed via localization after being filtered.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63005>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list