Ghost/core/server/api/canary
Fabien 'egg' O'Carroll 4604ba1587
Fixed backward compatibility for send_email_when_published (#12357)
no-issue

* Handled send_email_when_published in Posts API

This restores backwards compatibility of the Posts API allowing existing
clients to continue to use the `send_email_when_published` flag. This
change uses two edits, which is unfortunate. The reason being is that
this is an API compatibility issue, not a model issue, so we shouldn't
introduce code to the model layer to handle it. The visibility property
of the model is used to determine how to fall back, and because it can
be left out of the API request, and relies on a default in the settings,
we require that the model decide on the `visibility` before we run our
fallback logic (or we duplicate the `visibility` default at the cost of
maintenance in the future)

* Dropped send_email_when_published column from posts

Since this column is not used any more, we can drop it from the table.
We include an extra migration to repopulate the column in the event of
a rollback

* Updated importer to handle send_email_when_published

Because we currently export this value from Ghost, we should correctly
import it. This follows the same logic as the migrations for this value.

* Included send_email_when_published in API response

As our v3 API documentation includes `send_email_when_published` we must
retain backward compatibility by calculating the property.

* Fixed fields filter with send_email_when_published

* Added safety checks to frame properties

Some parts of the code pass a manually created "frame" which is missing
lots of properties, so we check for the existence of all of them before
using them.

* Fixed 3.1 migration to include columnDefinition

We require that migrations have all the information they need contained
within them as they run in an unknown state of the codebase, which could
be from the commit they are introduced, to any future commit. In this
case the column definition is removed from the schema in 3.38 and the
migration would fail when run in this version or later.
2020-11-11 13:03:41 +00:00
..
utils Fixed backward compatibility for send_email_when_published (#12357) 2020-11-11 13:03:41 +00:00
actions.js
authentication.js
authors-public.js
config.js Enabled Portal (#12317) 2020-11-03 14:36:21 +05:30
db.js
email-preview.js Refactor mega service to use stored email content and batch/recipient records 2020-09-29 17:17:54 +01:00
email.js
identities.js
images.js Removed global.Promise override (#12182) 2020-11-04 10:55:47 +00:00
index.js Added basic CRUD admin API for snippets 2020-10-16 18:02:58 +01:00
integrations.js
invites.js Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00
labels.js
mail.js
members.js Allowed for comped field when creating a member through Members API (#12278) 2020-10-14 13:24:09 +13:00
memberSigninUrls.js Updated getMagicLink call to handle Promise return 2020-09-18 10:49:18 +01:00
membersStripeConnect.js
notifications.js
oembed.js 🐛 Fixed broken embeds cards when pasting links to Wordpress sites (#12262) 2020-10-06 08:44:03 +01:00
pages-public.js
pages.js
posts-public.js
posts.js Fixed backward compatibility for send_email_when_published (#12357) 2020-11-11 13:03:41 +00:00
preview.js
redirects.js Added .yaml format support in redirects configuration (#12187) 2020-11-04 12:08:32 +13:00
roles.js
schedules.js 🐛 Fixed scheduled post emails pointing at /404/ for the "view online" link 2020-10-08 10:26:49 +01:00
session.js
settings-public.js
settings.js 🐛 Fixed email verification mails not sent 2020-09-24 23:39:25 +05:30
site.js Enabled Portal (#12317) 2020-11-03 14:36:21 +05:30
slack.js
slugs.js
snippets.js Added basic CRUD admin API for snippets 2020-10-16 18:02:58 +01:00
tags-public.js
tags.js
themes.js
users.js
webhooks.js Added check for parent integration_id when creating a webhook 2020-09-24 15:09:51 +12:00