Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently when cron runs and an edition is made, it then sits as waiting to be sent until the next cron run.
(This issue split off from #1461944: Cleanup and use simplenews api functions in _simplenews_scheduler_new_edition().)
On D6 we need to use module weights, but on D7 we can use http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
Comment | File | Size | Author |
---|---|---|---|
#3 | add_module_weight.patch | 1.83 KB | Berdir |
Comments
Comment #1
joachim CreditAttribution: joachim commentedI'm actually instinctively feeling icky about a dependent module being weighted to run before its dependency -- won't that have all sorts of knock-on effects including form_alter hooks?
I'm retitling this issue accordingly. Would it be possible to call simplenews's 'send newsletters' API function (whatever it is) at the end of our hook_cron()?
Comment #2
BerdirNo, we shouldn't do that. We actually don't even use simplenews_cron() here for example (we have disabled it using elysia cron) but instead have a simple script to get the newsletter out as fast as possible.
We're altering a form that is created by Simplenews, not after Simplenews altered it, so the module weight doesn't have any effect.
Comment #3
BerdirRe-adding the parts from the initial patch with updated update function number.
This is IMHO a perfectly fine thing to do. This works fine out of the box and you can always change the weight if you have specific requirements. We also don't touch sites which already have customized the weight.
I'm not sure if elysia cron relies on module weight and/or hook implementation order. I tried to have a look but they one of those projects who try to support both D6 and D7 with millions of conditions and versions checks and almost no documentation at the same time. Stopped bothering :p
Comment #4
joachim CreditAttribution: joachim commentedI have been wondering whether this is a feature rather than a bug...
Last month, when my site's cron run created the newsletter node, I had time to check it and fix a couple of errors on the content before it was sent by the next cron run :)
Comment #5
miro_dietikerLooks good to me, Berdir, but i think we should apply the condition for type=module in order to avoid other possibly wrong updates.
(Although there don't seem to be other different lines...)
Comment #6
dgtlmoon CreditAttribution: dgtlmoon commentedLooks fine to me
Comment #7
dgtlmoon CreditAttribution: dgtlmoon commentedcomitted