Ghost/core/server
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
..
adapters Moved utils constants to lib/constants 2017-12-14 14:13:40 +01:00
api Resurrect the old alpha Koenig editor (#9277) 2018-01-18 15:43:22 +00:00
apps Moved make-absolute-urls to url service 2017-12-14 22:34:37 +01:00
config Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00
controllers Moved tokens, url safe and safe string utility to lib/security 2017-12-14 13:38:00 +01:00
data Do not import unknown author id, fallback to owner id 2018-01-27 12:54:36 +01:00
helpers Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
lib Resurrect the old alpha Koenig editor (#9277) 2018-01-18 15:43:22 +00:00
models Avoid knex warning when destroying a user 2018-01-27 12:31:51 +01:00
public 🛠 🙈 Rename ghost-url.js to ghost-sdk.js (#8767) 2017-07-28 18:23:32 +04:00
services 🐛 Reload translations if active theme get's overridden (#9392) 2018-01-12 09:19:28 +00:00
translations Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00
views Fixed error trying to render 404 for missing asset 2017-12-22 20:08:59 +00:00
web Fixed bad references to common.i18n (#9402) 2018-01-17 17:28:42 +01:00
analytics-events.js Cleared out old unused events 2017-12-13 09:08:25 +00:00
filters.js Moved pipeline/sequence to lib/promise 2017-12-13 22:20:02 +01:00
ghost-server.js Always require fs-extra - consistency change 2017-12-13 20:57:11 +01:00
index.js Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
overrides.js Set Promise to be Bluebird globally 2017-12-13 20:57:11 +01:00
update-check.js Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00