Skip to content

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Jun 18, 2018

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

Fix preview host replacement for render calls.

Why?

Subrequest (e.g. twig render) are created with Request::create which will replace currently SERVER_PROTOCOL, HTTP_HOST, and many other headers which are currently not set in our Preview Request. If we forward them correctly in the preview they will not be overwritten by defaults.

Example Usage

  1. Open page in backend
  2. Use render function in template to render a sulu:link on a webspace with {host}
  3. without this fix localhost would be used instead of the current domain

@alexander-schranz alexander-schranz changed the title Fix preview host replacement for render calls Fix preview host replacement for render calls and avoid replace of href links Jun 18, 2018
@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch 2 times, most recently from 1483028 to 00a9627 Compare June 18, 2018 11:48
@alexander-schranz alexander-schranz changed the title Fix preview host replacement for render calls and avoid replace of href links Fix correct url in preview Jun 18, 2018
@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch 3 times, most recently from 930947b to faa789e Compare June 18, 2018 12:02
@alexander-schranz alexander-schranz added this to the Release 1.6 milestone Jun 19, 2018
@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch from faa789e to 40b57b4 Compare June 25, 2018 08:20
@alexander-schranz
Copy link
Member Author

ping @wachterjohannes

Copy link
Member

@wachterjohannes wachterjohannes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code and also the functionality for me looks good @chirimoya @danrot what do you think?

@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch 2 times, most recently from 35a37d9 to 974fbdd Compare June 27, 2018 15:47
@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch from 974fbdd to d282126 Compare June 27, 2018 16:14
@danrot
Copy link
Contributor

danrot commented Jun 27, 2018

It doesn't seem to work anymore with the SuluThemeBundle... However, I am not totally sure if that is my fault... Can you double check?

@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch from e251c54 to 459819a Compare June 28, 2018 09:04
@danrot
Copy link
Contributor

danrot commented Jun 29, 2018

Tested it on the sulu-standard edition, and it seems to work. But the tests are failing...

@alexander-schranz alexander-schranz force-pushed the hotfix/preview-host-replacement branch from 459819a to b13d2b1 Compare June 29, 2018 07:37
@wachterjohannes wachterjohannes merged commit d6663de into sulu:master Jun 29, 2018
@alexander-schranz alexander-schranz deleted the hotfix/preview-host-replacement branch September 7, 2018 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants