0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/test/integration
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
..
api 🐛 Fixed showing old release notifications in the about page 2018-01-18 12:19:55 +01:00
data/importer/importers Do not import unknown author id, fallback to owner id 2018-01-27 12:54:36 +01:00
model Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00
export_spec.js Moved ghost-version to lib 2017-12-14 22:14:55 +01:00
migration_spec.js Bump mocha to version 4.0.1 2017-11-29 10:34:36 +01:00
update_check_spec.js 🐛 Fixed showing old release notifications in the about page 2018-01-18 12:19:55 +01:00