0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server
Simon Backx 5657019e47
Fixed wrong newsletter used when sending scheduled post (#14734)
refs https://ghost.slack.com/archives/C02G9E68C/p1651939076681719

Cause:
- When a scheduled post was published via the post scheduler, no `newsletter_id` option is passed when editing the post.
- When editing a post via the posts service, without the `newsletter_id` option, the `newsletter_id` option is automatically set to the default newsletter's id.
- Inside the post model, this new `newsletter_id` was not saved, because it was already set, and changing it is prevented.
- The `mega` service wasn't using the (unchanged) post's newsletter_id, but used the option instead, which contained the default newsletter's id.

Fix:
- Always using the newsletter_id from the post and requiring the newsletter associated with a post to exist.
- This behaviour can be/is tested by publishing a scheduled post without any option.

Also cleaned up some `Object.assign` usages.
2022-05-09 17:30:50 +02:00
..
adapters 🔥 Removed versioned APIs 2022-04-28 15:37:09 +01:00
api Included newsletter relation by default in posts (#14723) 2022-05-09 11:06:59 +02:00
data Enabled Admin integration for newsletters API (#14714) 2022-05-09 20:46:34 +05:30
lib Added gravatar URL to config to make it configurable (#14490) 2022-05-09 12:44:04 +01:00
models Removed permissions handling of "author_id" 2022-05-09 20:34:06 +08:00
services Fixed wrong newsletter used when sending scheduled post (#14734) 2022-05-09 17:30:50 +02:00
views Updated unsubscribe page 2022-03-10 10:39:20 +00:00
web Update dependency @tryghost/mw-error-handler to v1 (#14719) 2022-05-07 15:28:28 +01:00
analytics-events.js
ghost-server.js Removed config and bluebird from ghost-server 2022-04-28 15:37:10 +01:00
notify.js Removed unused import 2021-12-06 08:17:07 +00:00
overrides.js
run-update-check.js Revert "Revert "Extract logging from DI patterns, only use @tryghost/logging package"" (#13884) 2021-12-14 11:22:39 +00:00
update-check.js 🔥 Removed versioned APIs 2022-04-28 15:37:09 +01:00