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

RogerRogers’s picture

Issue summary: View changes

This 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:

function simplenews_category_get_visible() {
  $categories = &drupal_static(__FUNCTION__, NULL);

  if (!isset($categories)) {
    $categories = simplenews_categories_load_multiple(array(), array('show_all' => user_access('administer simplenews subscriptions')));
  }
  return $categories;
}

The change is the addition of user_access('administer simplenews subscriptions'), this was a static value FALSE, 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.

rooby’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Priority: Normal » Major