0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/server/models
Kevin Ansfield 32f3f9d2c3 🐛 Fixed "unsaved changes" modal displaying when post has been saved
refs https://github.com/TryGhost/Ghost/issues/10477

The unsaved changes modal is displaying even when the post has been saved if images have been uploaded because the server is transforming absolute image urls to relative during input of the `mobiledoc` field but not transforming them back to absolute during output. The editor then thinks it's out of sync and shows the warning when trying to leave.

- `@tryghost/url-utils` has been updated with new methods for transforming URLs in mobiledoc content
- moves absolute->relative transformation from the API input serializers into the Post model
- transforms URLs in more fields for a more comprehensive transformation and fewer issues when re-configuring a site's domain
  - previously there could be problems with internal links between posts not being transformed so you could change the url config to newdomain.com but links in post content would still be pointing to olddomain.com
- updates the API post output serializers to transform all modified fields
- drops the `?absolute_urls=true` param switch from the `canary` API post output serializer so that all URLs are output as absolute
  - we're transforming more urls to relative when saving so this is necessary to ensure the unsaved changes modal is not triggered
  - the query param isn't documented and will disappear in v3
2019-10-07 22:59:19 +01:00
..
base Revert "Removed defaultColumnsToFetch from models (#11010)" (#11045) 2019-08-21 23:56:35 +05:30
plugins Revert post.page->post.type handling 2019-08-19 12:02:14 +01:00
relations 🐛 Fixed field filtering for /authors/:id endpoints 2019-03-05 15:18:32 +08:00
accesstoken.js Ensured consistency for event handlers in the model layer 2019-02-07 11:02:35 +01:00
action.js Added model implementation for actions 2019-02-06 21:36:09 +01:00
api-key.js Created DB Backup integration (#10974) 2019-08-02 17:28:02 +08:00
app-field.js
app-setting.js
app.js Updated permittedOptions to correctly call super 2018-09-21 12:15:29 +02:00
author.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
client-trusted-domain.js
client.js Updated permittedOptions to correctly call super 2018-09-21 12:15:29 +02:00
index.js Renamed members_stripe_info to members_stripe_customers 2019-09-26 12:58:29 +07:00
integration.js Ensured Admin API cannot fetch internal integrations (#10501) 2019-07-24 11:52:55 +02:00
invite.js Updated permissible methods for hasApiKeyPermissions (#9970) 2019-01-18 13:39:53 +01:00
member-stripe-customer.js Renamed members_stripe_info to members_stripe_customers 2019-09-26 12:58:29 +07:00
member.js Renamed members_stripe_info to members_stripe_customers 2019-09-26 12:58:29 +07:00
mobiledoc-revision.js Added mobiledoc revisions functionality 2018-10-09 15:31:09 +02:00
permission.js 🔥 Drop Node v4 Support 2018-05-01 14:06:18 +02:00
post.js 🐛 Fixed "unsaved changes" modal displaying when post has been saved 2019-10-07 22:59:19 +01:00
refreshtoken.js Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
role.js Updated permissible methods for hasApiKeyPermissions (#9970) 2019-01-18 13:39:53 +01:00
session.js Removed user_id constraint when upserting session (#10085) 2018-10-30 16:15:48 +07:00
settings.js Update Test & linting packages (major) (#10858) 2019-07-05 13:40:43 +02:00
subscriber.js Ensured consistency for event handlers in the model layer 2019-02-07 11:02:35 +01:00
tag-public.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
tag.js Updated Tag model to support actions 2019-08-14 17:40:36 +08:00
user.js Updated User model to support actions 2019-08-14 17:40:36 +08:00
webhook.js Ensured consistency for event handlers in the model layer 2019-02-07 11:02:35 +01:00