You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 Fixed member newsletter subscription not saving in Admin (#16490)
fixeshttps://github.com/TryGhost/Team/issues/2783
refs cb05fae
The root cause of the issue was the fact we no longer checked for lack of `newsletters` property on member data before checking its `subscribed` property which is now deprecated. This caused a cascading effect where `subscribed:false` property on a member overrides the value for `newsletters` data. The check was accidentally removed in a previous bug fix.
So for members that were not subscribed to any newsletters, saving a newsletter subscription failed as they had their `subscribed` set to `false`, and it was resetting the newsletter subscription to empty always.
Copy file name to clipboardExpand all lines: ghost/core/test/e2e-api/admin/members.test.js
+65
Original file line number
Diff line number
Diff line change
@@ -2442,6 +2442,71 @@ describe('Members API', function () {
2442
2442
assert.ok(changedMember.newsletters.find(n=>n.id===testUtils.DataGenerator.Content.newsletters[1].id),'The member is still subscribed for the newsletter it subscribed to');
2443
2443
});
2444
2444
2445
+
it('Adding newsletters to member with no subscriptions works even with subscribed false',asyncfunction(){
assert.ok(changedMember.newsletters.find(n=>n.id===testUtils.DataGenerator.Content.newsletters[0].id),'The member should be subscribed to the newsletter');
2508
+
});
2509
+
2445
2510
it('Updating member data without newsletters does not change newsletters',asyncfunction(){
2446
2511
// check that this newsletter is archived, or this test would not make sense
0 commit comments