You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When some code is run in hook_user_presave(), an easy way to bulk update user accounts would be to use the actions at the top of /admin/people/list. However there's not currently an action to save the user account (to trigger this hook).
Proposed solution
Add an action that simply saves the user account(s), triggering the presave hook.
Alternatives that have been considered
An alternate solution is to use the 'Block user(s)' action. That triggers the presave hook, but then you need to unblock the users again. That triggers (by default) an email to be sent to users, and could be problematic if you'd prefer to have these changes made without triggering emails to be sent...
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes a 'Save user(s)' action.
The text was updated successfully, but these errors were encountered:
Unless I'm missing something, this seems to me like a rather fringe and circuitous use of save (saving something only to trigger a presave hook). From a developer point of view, I feel inclined to say that if someone needs to run a specific process at will on an entity, they should create a custom action that runs that process.
However, I can see how a developer may benefit from a contrib module that invokes specific hooks for entities - this done without actually saving the entity, but only invoking specific hooks with those entities. This could be helpful for debugging (though I would probably use Devel to run these hooks manually).
As a side note, Views Bulk Operations contains a "Modify entity values" that could be used to just save entities without modifying anything, thus triggering all hooks.
Description of the need
When some code is run in
hook_user_presave()
, an easy way to bulk update user accounts would be to use the actions at the top of/admin/people/list
. However there's not currently an action to save the user account (to trigger this hook).Proposed solution
Add an action that simply saves the user account(s), triggering the presave hook.
Alternatives that have been considered
An alternate solution is to use the 'Block user(s)' action. That triggers the presave hook, but then you need to unblock the users again. That triggers (by default) an email to be sent to users, and could be problematic if you'd prefer to have these changes made without triggering emails to be sent...
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes a 'Save user(s)' action.
The text was updated successfully, but these errors were encountered: