Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Currently admins cannot administer subscribers of hidden newsletters on the admin/people/simplenews/users/edit/% page because of the code in simplenews_subscriptions_admin_form():
<?php
// Get newsletters for subscription form checkboxes.
// Newsletters with opt-in/out method 'hidden' will not be listed.
foreach (simplenews_category_get_visible() as $newsletter) {
$options[$newsletter->tid] = check_plain($newsletter->name);
$default_value[$newsletter->tid] = FALSE;
}
?>
Not even user 1 can get around this because there are no permissions involved.
Maybe we could add another permission for administering hidden subscriptions and utilise it wherever there is currently a restriction.
I thought I had another possible option but now I can't remember it.
Comments
Comment #1
RogerRogers CreditAttribution: RogerRogers commentedThis issue really needs to be addressed. At present any newsletters that aren't publicly available for subscription cannot be managed, even by admins. Why even have newsletters that aren't publicly available, since it is impossible to subscribe users to these newsletters?
Anyway, here is a quick fix, in simplenews.module find this function and amend as shown:
The change is the addition of
user_access('administer simplenews subscriptions')
, this was a static valueFALSE
, which is replaced with the user_access() check to allow any user that has been granted 'administer simplenews subscriptions' permission to be able to edit all subscriptions for the given user.Hope this helps someone. Ideally this will be added to the module codebase. Granted, I'm using an older version of the module, so maybe it has already been added... and if so, this issue should be closed.
Comment #2
rooby CreditAttribution: rooby commented