mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +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. |
||
---|---|---|
.. | ||
api/canary | ||
frontend | ||
server | ||
shared |