0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/services
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
..
adapter-manager
api-version-compatibility Fixed missing failed request URL if version emails 2022-05-09 20:11:25 +08:00
auth Removed versioning from api-key/admin auth 2022-05-06 08:09:54 +01:00
bulk-email Added newsletter info to email unsubscribe url (#14693) 2022-05-05 11:00:24 +05:30
email-analytics
integrations
invitations
invites
jobs
mail Extracted email-content-generator into a package 2022-05-04 17:28:09 +08:00
mega Fixed wrong newsletter used when sending scheduled post (#14734) 2022-05-09 17:30:50 +02:00
members Update dependency @tryghost/url-utils to v3 (#14705) 2022-05-05 16:10:18 +01:00
newsletters Fixed newsletter includes when adding or editing (#14696) 2022-05-05 11:20:15 +02:00
notifications
offers Fixed same redirectManager used in offer service between tests (#14340) 2022-03-24 10:18:52 +01:00
permissions
posts Fixed wrong newsletter used when sending scheduled post (#14734) 2022-05-09 17:30:50 +02:00
public-config
redirects
route-settings Removed sync method from route settings loader 2022-04-28 15:37:09 +01:00
settings
stats Replaced stats service with @tryghost/stats-service (#14527) 2022-04-21 14:57:07 +01:00
stripe Cleaned up output errors during tests 2022-04-05 18:17:47 +08:00
themes Switched gscan to validate against v5 set of rules 2022-05-02 20:56:25 +08:00
url Removed api:versions from config 2022-05-06 08:22:05 +01:00
webhooks Fixed undefined error when serializing webhooks 2022-05-03 11:40:59 +01:00
custom-theme-settings.js
limits.js
nft-oembed.js
oembed.js Added missing message string 2022-03-21 09:07:54 +00:00
slack.js Replaced schema.isPost in slack service /w custom fn 2022-04-05 14:24:42 +01:00
twitter-embed.js
users.js Renamed destroyByAuthor to reassignByAuthor 2022-04-28 15:37:13 +01:00
xmlrpc.js