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.
I notice there is a TODO for this hook. I need access to this hook for my simplenews SMS add-on.
Patch to follow.
Comment | File | Size | Author |
---|---|---|---|
#13 | hook_simplenews_send-1560084-12.patch | 943 bytes | rurri |
#10 | hook_simplenews_send-1560084-9.patch | 883 bytes | rurri |
#8 | hook_simplenews_send-1560084-7.patch | 881 bytes | rurri |
#5 | hook_simplenews_send-1560084-4.patch | 878 bytes | rurri |
#1 | hook_simplenews_send-1560084.patch | 5 KB | rurri |
Comments
Comment #1
rurri CreditAttribution: rurri commentedHere is the patch to make the hook happen.
Comment #2
rurri CreditAttribution: rurri commentedBasically this patch just replaces
with
adds documentation for the hook, and then creates a single method that implements the hook and calls the spool
Comment #3
rurri CreditAttribution: rurri commentedComment #4
BerdirAdding a hook sound useful but it's not necessary to change the API for this. Simply place the module_invoke_all() call inside simplenews_add_node_to_spool().
Then your patch is simplified to an additional line + maybe a comment and the api.php changes.
Looks like you've overriden one of the placeholder defgroups. We do want to keep that..
Comment #5
rurri CreditAttribution: rurri commentedSimplified patch
Comment #6
rurri CreditAttribution: rurri commentedComment #7
BerdirTrailing space on the first line.
Comments should have a space after the // and end with a .
Looks good after this, much simpler now :)
Comment #8
rurri CreditAttribution: rurri commentedRemoved space and fixed comment.
Comment #10
rurri CreditAttribution: rurri commentedNot sure how change the comment caused that one to fail.. but in any case, changed the variable name in the api.php to be $newsletter in this one.
Comment #11
Berdir#8: hook_simplenews_send-1560084-7.patch queued for re-testing.
Comment #12
BerdirThis is a problem with the test, that one fails sometimes. Triggered a re-test.
Actually, let's just name the variable @node and also add a @param to the docblock explaining that this is the sent node.
It's not the newsletter/category that we are passing to that function.
Comment #13
rurri CreditAttribution: rurri commentedMinor changes to docbloc in api
Comment #14
BerdirLooks good, commited, thanks!