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.
- Move all notifications related settings from og to og_notifications, converting, where appropriate, to use the messaging API.
- Delete unnecessary configuration options.
- Do not display configuration options on all user_edit forms - just the primary tab.
- Job queue recommendations have been removed.
- Reuse hook_og to communicate with notifications modules - in this case og_notifications - to relay administrative messages. The newly introduced ops are 'user request', 'user approve', 'user communicate', 'admin create' and 'admin new'. All the features and advantages of the messaging API are available for admins and other modules to customise as necessary. While most of these 'ops' are named after the message template variables already in use in og.module for consistency and possible reuse by other modules, 'user communicate' is for generic usage and is currently being used by the "e-mail all members" form. The invite form is yet to use this system.
- The messaging API's queueing system has been a little buggy during testing. Currently, forced queueing of bulk messages has been turned off.
- There might also be a better way to send and indicate bulk messages through the messaging API. Currently, recipients are looped through in og and messages transmitted individually. Needs to be investigated.
- The messaging API provides options to split messages into header, body and footer (etc.) - perhaps this can be made an administrative option in the future. The token module is also available for use as it is a pre-req for notifications.
- Notifications related fields and tables have been removed from .install. However, the upgrade path needs to be discussed before proceeding - please see notes in patch (in the .install file). Please also note in particular the changes triggered in og.install by the removal of og_uid_global.
- A number of configuration options have been retained in og.module rather than being moved to og_notifications in case other similar modules want to use them.
During testing, using the "debug tool" messaging module will very likely prove helpful. Its output can be seen on the recipient's user account page. Please disable notifications_og and any og_mail related modules prior to applying the patch.
This patch has only seen rudimentary testing and only with "simple mail". The D6 upgrade patch is based off this one and currently only satisfies coder module and is untested.
Cheers,
-K
Comment | File | Size | Author |
---|---|---|---|
#3 | notifications_og13.patch | 66.68 KB | Zen |
notifications_og7.patch | 49.64 KB | Zen | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedAfter a code review, I only found minor comments.
- i don't yet understand this: "'user communicate' is for generic usage". the way you are using it, i would rename the op to 'user broadcast'
- you removed a needed space at: + '!group_url'=> url("node/$node->nid", NULL, NULL, TRUE)
- remove the word 'organic': "t('Automatically enable notifications for any organic groups that I join.')"
- README.txt for OG ought to mention og_notifications module and its benefits. og_notifications should have its own brief README.
- please do investigate 6+7 and see what we can do better. we really need to use a queue for performance sake. sending a few thousand emails (yes, groups get that big) in real time is a killer.
Yes, I like your idea about doing the migration in og_notifications_enable() or og_notifications_install().
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedI looked briefly at the cron features of Notifications
In particular the 'user_allowed' callback should be helpful for ensuring that the recipient is still subscribed to the group (might have cancelled since last cron run). If we don't do that, then we ought to delete from the notifications queue when a user leaves a group.
Comment #3
Zen CreditAttribution: Zen commentedA rudimentary upgrade function is in place. But, it needs testing and is yet to support the port of the "autosubscription" setting into the user table which is going to involve jumping through hoops. I'm looking to avoid user_loads as much as possible. IIRC, this is almost always accomplished with regex applied to the users.data field. If you are aware of a better way to do this, please let me know.
Testing: Can I get a sample database dump to test the upgrade? A sanitised g.d.o perhaps?
-K
Comment #4
Zen CreditAttribution: Zen commentedre: cron features - I'm pretty sure that notifications takes care of this automatically. The messaging queue, however, does not. og_notifications only uses the messaging module directly for administrative tasks and only bulk messages are queued.
-K
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedI will take a look at the new patch. Thanks.
You should not need to peek into users.data at all. The autosubscribe column for a user is in og_uid_global table.
I will investigate providing a sanitized groups.drupal.org DB.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedCode review
* Why are admin messages delivered in a single delivery method and not in the recipient's desired method?
* Missing 2nd param: $flag = variable_get('og_notifications_update_required');
I am testing this now but am fighting with Notifications/Messaging a bit. Will post here again.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedSo, it seems that og_notifications is not required but *some* similar module is required or else you will not get any admin email, the broadcast tab silently fails, etc. Any thoughts on how to resolve this? Perhaps we limit og_notifications to just caring about notification mail and not admin mail? Or we do a hook_requirements() which looks for implementations of 'user broadcast' hook (for example) and if there are none, it yells.
FYI, I am committing og_notifications to the HEAD branch just so that we have consistent files as requested at http://drupal.org/node/254655. It certainly isn't working there yet.
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commented@Zen - perhaps we should use notifications_lite to send our messages? it can be found in the notifications package and discussed at http://drupal.org/node/253109
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedSo, what I think we should do is create a new DRUPAL-5-3 branch and commit this and then keep working on it there. Zen is welcome to do that at any time.
* need help text at top of user/[n]/notifications/group
Comment #10
Zen CreditAttribution: Zen commentedIssues that you've mentioned which have been fixed:
Broadcast tab failing silently when og_notifications is not enabled: Perhaps we can just make it a warning via hook_requirements?
-K
Comment #11
moshe weitzman CreditAttribution: moshe weitzman commentedThis has been committed to 5 and 6. Please file new issues as needed.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.