I am surprised that the hidden newsletters are visible even on the admin page - that seems like a bug to me.

  1. They were hidden even for admin in D7.
  2. There are important use cases for hiding newsletters from admin. E.g. a site that sends important membership information to all members via a newsletter - we don't want to allow an admin to accidentally turn that off for one member.

I propose that we reset the meaning of hidden to mean hidden from all, matching D7. If anyone wants to make the case for adding "hidden, but admin can edit" then this can be a separate feature request.

Comments

AdamPS created an issue. See original summary.

adamps’s picture

Assigned: Unassigned » berdir

I can write a patch for this. @Berdir - please can you check my proposal and let me know if you agree with this approach.

adamps’s picture

adamps’s picture

Assigned: berdir » Unassigned

In fact it's clear from the code for SubscriberForm that this is accidental behaviour.

    $form = parent::form($form, $form_state);
    $this->getSubscriptionWidget($form_state)
      ->setAvailableNewsletterIds(array_keys(simplenews_newsletter_get_visible()));

There is an attempt to restrict to visible simplenews_newsletter_get_visible(), but unfortunately it's too late - this line needs to go before the call to build the parent form.

I'll create a patch.

adamps’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.