Hello,
I found out that if you modify custom notifications fields, it won't spread to subscribed users. That's why I thought that custom notifications were not sent (see here).
Users have to do a change (for instance unsubscribe and subscribe again to the custom notification) to reflect changes made by the administrator. It behaves this way because notifications_save_subscription() is called only when the user is subscribing.
notifications_save_subscription() is responsible for the creation or updating in notifications_fields table for instance.
Fields modification needs to call notifications_save_subscription() for each subscribed user. I will try to propose a patch.
Barberousse
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | notifications_custom.admin_.inc_.patch | 1.34 KB | Barberousse |
| #4 | notifications_custom.module.patch | 1.13 KB | Barberousse |
| #1 | notifications_custom.module.patch | 1.09 KB | Barberousse |
| #1 | notifications_custom.admin_.inc_.patch | 1.94 KB | Barberousse |
Comments
Comment #1
Barberousse commentedHello,
These patches gives the ability to spread modification made to one custom subscription to each subscribers.
It adds the missing delete button to the custom subscriptions.
Barberousse.
Comment #2
Barberousse commentedComment #3
stmind commentedJust a quick comment about the missing delete button portion of the patch: You might reroll the patch to not include that fix. The if-statement is valid, just reversed.
See my patch in #514082: Delete custom subscriptions:
http://drupal.org/node/514082#comment-2419396
Comment #4
Barberousse commentedHello,
Sorry for the delay, I rerolled the patch without your other fix.
Best regards.
Barberousse
Comment #5
Anonymous (not verified) commentedWill this patch turn on or establish custom subscriptions for all users even if never established or if the notification table was truncated? My issue is that there is no way to apply the custom notification for existing users without touching each record. Same issue exists for notification tags as in forum topics.
Comment #6
Barberousse commentedHello,
You can still try the patch but I think that you can already achieve what you need, if I understand correctly : in admin/user/user/list you can select users and subscribe them to your custom subscriptions. It's not obvious because it's not the same place as in messaging/subscriptions/admin where you can activate, delete, etc. subscription but you can not subscribe users to custom subscriptions from there.
Barberousse.
Comment #7
jose reyero commentedFirst, this module has been moved into the main Notifications framework for 4.x which is where these features will be considered. Notifications custom for 2.x is quite a rough module, don't expect too much improvements here.
The idea looks good, to be tested for this 4.x branch. About the current patch, it looks good though I have some concerns with the performance for sites with too many users/subscriptions. I think the update part can be rewritten with just a few queries to update all subscriptions at once (delete fields, recreate fields).
Comment #8
jose reyero commentedFixed with some fastest queries.
Comment #10
marinex commentedHi I need a help. I would like fix the Conditions count not updated for exiting subscriptions. I applied the patch with little modification, because I need update the CONDITION field of notifications table when I update custom subscription. I added a
$subscription->conditions = count($subscription->fields);to notifications_custom_user_profiles_update(). If I added a field to custom subscription all is OK. But if I delete a field, problem is the notifications_save_subscription() because it return FALSE because check_fields() return FALSE:Theese values are not equal ( in notifications_subscription.class.inc ).
Can you help why $this->get_fields() and $this->get_type_fields() return different values?
Thank you for help
Comment #11
marinex commented