New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute paths in `html` field #10472

Closed
kirrg001 opened this Issue Feb 8, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@kirrg001
Copy link
Contributor

kirrg001 commented Feb 8, 2019

Refs:
#10466
#1354
https://forum.ghost.org/t/json-file-from-ghost-1-to-ghost-2-help/5580

Introduced via a463a56.

Need to figure out if this behaviour is really broken or it was wishful from the beginning.

But the commit definitely changed a behaviour, which breaks an import/export flow.
This either needs to be handled differently for import/export, fix the html or documented correctly.


Previously:

  • you uploaded an image in the editor
  • it was returned relative and stored relative in the html field in the db
  • you served the post and the API automatically transforms asset paths to absolute
  • you export a JSON and import the JSON into a different domain, everything is fine, because paths are stored relative and served absolute

Now:

  • you uploaded an image in the editor
  • it is returned absolute and stored absolute in the html field in the db
  • you served the post and the asset paths are already absolute
  • you export the JSON and import the JSON into a different domain, everything is "broken", because paths are stored absolute, but domain might/has changed

Ghost: master/latest

@kirrg001

This comment has been minimized.

Copy link
Contributor Author

kirrg001 commented Feb 8, 2019

Refs #9832

@kirrg001 kirrg001 added needs info and removed bug labels Feb 8, 2019

@gargol gargol referenced this issue Feb 11, 2019

Open

Assets & Resources URL rules #10477

1 of 2 tasks complete
@gargol

This comment has been minimized.

Copy link
Contributor

gargol commented Feb 11, 2019

As summed up in #10477, current behavior (returning absolute URL for /images endpoint) is correct. The transform needs to be applied to any asset in mobiledoc field (consequently html) containing absolute URLs to be changed into relative ones 👍

@gargol gargol added admin-api and removed needs info labels Feb 11, 2019

@gargol gargol closed this in e47d1e2 Feb 11, 2019

gargol added a commit that referenced this issue Feb 12, 2019

Fixed tests for post input serialization
refs #10472

- Moved config related variable into function scope, so it can be reset by unit tests
- e47d1e2 broke the build and is being fixed by this commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment