It'd be great if whenever update.module automatically discovered your site was missing some updates, that it triggered actions defined via the actions.module. After a few emails and IRC chats with John "Mr Action" VanDyk, it seems as though the best way to do this is to introduce a hook that update.module invokes when the site is out of date. Then, it's trivial to tell actions.module about this hook, and then site admins can assign actions to it via the actions UI.
We could even move the email notification code already hard coded in here into update.module's implementation of its own hook, for clarity that "this is code that should happen if the site is missing updates". I still support leaving the email notification setting and functionality in update.module, even if we have actions, since I think it's a very simple, obvious kind of notification and we should keep it as easy as possible for site admins to know if their site is out of date. Also, I can certainly imagine update_advanced.module wanting to do other things when this hook fires, so it's not *only* useful for actions integration...
The only alternative to a new hook for this would be a bunch of extra actions-specific code in update.module to manage and invoke the actions directly. There is no documentation about how to do this, and John's on vacation for a while, too. :(
So, if there are no objections, I'd like to move forward on a patch to introduce a hook ("hook_updates_available"?) that's fired by update_cron() when it finds the site out of date, move the email notification sending code into update.module's implementation of its own hook, and add the update_hook_info() implementation to tell actions about this new hook.
Dries/Gabor? If I write this, will it land for D6? ;) Any better suggestions for the name of the hook?
Thanks,
-Derek
p.s. Consider this in "Concept needs feedback" status... ;)
Comments
Comment #1
dwwUgh, I missed. ;)
Comment #2
pwolanin CreditAttribution: pwolanin commentedSince actions module is not required, it seems prudent not to have the basic e-mail notice depend upon it.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedi think this is a good case for enabling actions by default and adding this action by default.
separately, actions needs a confirm when disabling it like: "are you sure? you have 3 active actions."
Comment #4
dwwComment #5
Pasquallesubscribe
Comment #6
webchickIncidentally, #2 is untrue now. Actions themselves are in actions.inc, which is a core file that is always included, it's *Trigger* module (the module that provides a UI for mapping actions to hooks) that is not included by default. So there should be no issue for someone who wants to try and work this up.
Comment #7
Dave ReidBumping to 8.x.
Comment #8
valthebaldam I right that solution would be to implement hook_action_info() and call appropriate action in _update_refresh()?
Comment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedGoing to say this is a won't fix as the action module is being deprecated #3343369: [meta] Tasks to deprecate Actions UI module
Comment #22
quietone CreditAttribution: quietone at PreviousNext commentedYes, the action module is being deprecated but it only provides the UI. The action entity is provided by the system module. On that basis, this should stay open.
Cheers