By adamps on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
4.x
Introduced in version:
4.0.0-alpha3
Issue links:
Description:
User interface changes
1) The “Subscribers” list page (/admin/people/simplenews) changes to match the new data model (see below). Please check your view after upgrade as you may want to adjust it, or reset back to the new default.
- Rename "Active" column to "Status", with 3 values: ACTIVE, BLOCKED, UNCONFIRMED. Remove the “Subscriber Status” filter, and add “Unconfirmed” to the "Status" filter.
- Unconfirmed subscriptions are now listed in their own row (instead of being part of the row for the confirmed subscriber).
2) Subscriber forms:
- The fields created, subscriptions and langcode now use standard core widgets, instead of the previous hard-coded form fields.
- Of these, created and subscriptions are configurable in manage form display, but langcode is not.
- The default settings are a fairly close match to the previous hard-coded settings.
API changes
- Add
Subscriber::sendConfirmation(). Subscriber::setStatus()andSubscriber::getStatus()now use an integer with 3 possible values: ACTIVE, BLOCKED, UNCONFIRMED (instead of boolean). Add shortcut functionsisActive()andisConfirmed().- Remove Subscriber::getChanges()/setChanges().
- Both
Subscriber::subscribe()andSubscriber::unsubscribe()now take only one parameter. - Add new parameter
Subscriber::loadByMail($checkTrust = FALSE). If TRUE, then callskipConfirmation()and if FALSE force creating a new subscriber and set it to unconfirmed. - In
Subscriber::loadByUid(), add a new parameter$confirmed = TRUE. if TRUE only return a confirmed subscriber. - In
Subscriber::loadByMail(), add a new parameter$check_trust = FALSE. If TRUE and the current user is untrusted then force creating a new subscriber. - In SubscriptionManager::subscribe()/unsubscribe(), remove
$confirmand$sourceparameters. This function now always acts as if $confirm is FALSE. To send a confirmation, the calling code needs to group changes together using a Subscriber object: - Subscriber::loadByUid()
- Modify subscriptions
- Subscriber::sendConfirmation()
- In
SubscriptionManager, removesendConfirmations(), addConfirmation(), requiresConfirmation(), reset(). - New parameter on Subscriber::fillFromAccount() to allow copying of only base fields.
- Remove Subscriber::getSubscription(). To check the current subscription use
isSubscribed()and for history checkSubscriberHistoryentities.
Data model changes
The Subscriber entity changes as follows:
- Remove
changesfield. - Change the subscriptions field to be
entity_reference, delete@FieldType simplenews_subscription. - Change status field to a tiny int, with 3 values: ACTIVE, BLOCKED, UNCONFIRMED.
New SubscriberHistory entity.
Impacts:
Site builders, administrators, editors
Module developers
Themers
Site templates, recipes and distribution developers