mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
69d07c892c
no issue When using `getLazyRelation` on an optional relation that is not set, it will return a newly created model instead of a model from the database. - Adds a new require option to `getLazyRelation`, that throws an error if the relation is not set (off by default to match existing use cases) - This caused a bug (not visible because we always pass a newsletter id) in email previews, where when the newsletter id was not explicitly set, it would use `newsletter = (await post.getLazyRelation('newsletter')) ?? (await this.models.Newsletter.getDefaultNewsletter());`, which always returned the first one, and could return a newly initiated newsletter with all properties set to undefined. - Some page snapshots are altered by this, because the usage of `getLazyRelation` on a post no longer sets the email relation to some new model. |
||
---|---|---|
.. | ||
base | ||
api-key.test.js | ||
comment.test.js | ||
custom-theme-setting.test.js | ||
email-spam-complaint-event.test.js | ||
integration.test.js | ||
invite.test.js | ||
member-click-event.test.js | ||
member-created-event.test.js | ||
member-feedback.test.js | ||
member-paid-subscription-event.test.js | ||
member-subscribe-event.test.js | ||
member.test.js | ||
milestone.test.js | ||
newsletter.test.js | ||
permission.test.js | ||
post.test.js | ||
session.test.js | ||
settings.test.js | ||
single-use-token.test.js | ||
stripe-customer-subscription.test.js | ||
subscription-created-event.test.js | ||
suppression.test.js | ||
tag.test.js | ||
user.test.js |