0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/api/v2
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
..
utils 🐛 Fixed "unsaved changes" modal displaying when post has been saved 2019-10-07 22:59:19 +01:00
actions.js
authentication.js Switched to use v2 http module instead of ovelooked v1 2019-08-01 13:06:15 +02:00
authors-public.js
config.js
db.js Created DB Backup integration (#10974) 2019-08-02 17:28:02 +08:00
images.js
index.js Migrated schedules controller to v2 2019-08-07 14:51:36 +02:00
integrations.js
invites.js
mail.js Updated links to docs (#10941) 2019-07-22 18:17:50 +08:00
members.js Added members CSV export to Admin API (#11198) 2019-10-03 20:36:22 +02:00
notifications.js
oembed.js Refactored oembed controller data validation 2019-08-01 17:13:12 +05:30
pages-public.js
pages.js Migrated schedules controller to v2 2019-08-07 14:51:36 +02:00
posts-public.js
posts.js Migrated schedules controller to v2 2019-08-07 14:51:36 +02:00
preview.js
redirects.js Extracted frontend code from redirects API controllers (#10798) 2019-06-21 16:50:16 +02:00
roles.js
schedules.js Migrated schedules controller to v2 2019-08-07 14:51:36 +02:00
session.js
settings-public.js 🎨 Added url value to the Content API /settings/ endpoint (#10946) 2019-07-24 11:12:07 +01:00
settings.js Moved settings dynamicRouting to routing.settings 2019-06-21 16:34:17 +02:00
site.js
slack.js
slugs.js
subscribers.js
tags-public.js
tags.js
themes.js 🐛 Fixed cache invalidation header on theme override 2019-07-17 18:41:25 +05:30
users.js Fixed ability for the owner to change password of other users 2019-07-22 19:00:21 +02:00
webhooks.js