Saving "Bulk-subscribe all unsubscribed users" does the opposite

Created on 19 May 2024, about 1 year ago

Problem/Motivation

Hi all,

In the plugin config, checking and saving "Bulk-subscribe all unsubscribed users" does not save unsubscribed users with the default settings. In my testing, it actually de-selected the content type subscribed users had chosen leading to some confusion. Subscribed users Master settings/Detailed settings were left untouched.

The description beneath the "Bulk-subscribe all unsubscribed users" checkbox is as follows:
'Apply “Default Settings” to all non-blocked users that do not already subscribe to notifications. Users that already has enabled “Receive email notifications” under their “Notify Settings” will not be affected. '

The “Default Settings” are correct, and I have tested they work. When a new user is created that have the default settings.

Does any one else experience this?

Cheers

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇿New Zealand dominictaylor

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dominictaylor
  • 🇬🇧United Kingdom grdv

    Same here.
    * Doesn't subscribe all users.
    * Deselects existing content type settings

  • 🇬🇧United Kingdom The Daily Clobe

    Same here:
    * Doesn’t subscribe all users
    * Removes all items from the notify_subscriptions table

    In addition, even when submitting “Submit configurations” on the /admin/config/people/notify/users page without ticking “Bulk-subscribe all unsubscribed users”, all items are still removed from the notify_subscriptions table. I think that the cause is:
    - The setUserNotify() method interprets the absence of subscription values as a request to delete all subscriptions
    - The UsersForm only passes basic notification settings and does not include subscription information

    I’ve created a patch that does the following:
    - Adds a check in setUserNotify() to only process subscriptions if subscription values are present
    - Prevents unintended deletion of subscriptions while maintaining compatibility with existing functionality

    Note: This patch only addresses the removal of items from the notify_subscriptions table when using “Submit configurations” on the /admin/config/people/notify/users page. It does not resolve the issue of users not being subscribed when ticking “Bulk-subscribe all unsubscribed users.”

  • 🇬🇧United Kingdom The Daily Clobe

    It looks like there are a couple of reasons why users are not being subscribed when ticking "Bulk-subscribe all unsubscribed users."

    1. bulkSubscribeUsers() is only updating users who already have entries in the notify table; it’s missing users who are not yet in the table.
    2. bulkSubscribeUsers() does not add any entries to the notify_subscriptions table, so users are marked as "subscribed" in general but are not subscribed to any specific content types.

    I’ve created a patch to update bulkSubscribeUsers() to do the following:
    - Find all active users without any record in the notify table and added them to the notify table
    - Find users with existing records but disabled notifications and updated them as enabled in the notify table
    - Created new subscriptions in the notify_subscriptions table for all added/updated users, subscribing them to the node types specified in the Default Settings page

    This patch includes the updates from my previous patch, which addressed the unintended deletion of subscriptions.

Production build 0.71.5 2024