0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00
ghost/core/server/data
kirrg001 82bb3aaea1 Do not import unknown author id, fallback to owner id
no issue

- if you import a JSON file with a post, which has an unknown author,
  the target user was removed from the blog
- Ghost can handle this case and still succeeds with import
  - but we have stored an `author_id` in the database, which does not map to any user and won't map in the future
- this can trouble if we add support for multiple authors
  - currently, we only return the `author_id` to the client and the client can map with `author_id` with users fetched by the API
    - if it does not find a user, it just falls back to a different user
  - but multiple authors have to be included explicit (`include=authors`) and we will return a mapped (author_id => user) result
  - it won't be able to find the user, because we lookup the database
  - this would result in an error
- there is in general no reason to import (or store) an unknown/invalid `author_id` into the database
- on import, we show you a warning and you can choose a different author if you want
- solution: fallback to owner user and extend warning
  - it's not a behaviour change, you still can import unknown author id's and the import won't fail
  - but we ensure valid author id's
- updated test
- further more: returning `author={}` when requesting `include=author` could trouble with ember currently
  - it expects the author to be returned
2018-01-27 12:54:36 +01:00
..
db Backup endpoint improvements (#9365) 2018-01-11 16:03:21 +01:00
export Backup endpoint improvements (#9365) 2018-01-11 16:03:21 +01:00
importer Do not import unknown author id, fallback to owner id 2018-01-27 12:54:36 +01:00
meta Moved social utility to lib/social 2017-12-14 22:34:05 +01:00
migrations Fixed 1.20 migration script 2018-01-09 21:38:13 +01:00
schema Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00
validation Moved validateRedirects helper to data/validation 2017-12-14 11:55:10 +01:00
xml/sitemap Import lib/common only 2017-12-12 10:28:13 +01:00
timezones.json Adds UTC as select option to timezones select list 2016-06-10 15:19:16 +02:00