0

The app gets installed on our integration-server + a folder for the branch (http://integration/feature-abc/)

Symfony 2.8 behavior

asset('/image.png') => generates /feature-abc/image.png

absolute_url(asset('/image.png')) => generates http://integration/feature-abc/image.png

Symfony 3.4 behavior

asset('/image.png') => /feature-abc/image.png

absolute_url(asset('/image.png')) => generates http://integration/image.png

The feature-folder (/feature-abc/) is missing when using absolute_url

Before upgrading from symfony 2.8 to 3.4 the urls were generated corretly.

Anyone has a clue why this is happening?

2
  • I'm actually surprised about how it worked in the first place. Probably a default web assets folder in your assetic configuration Commented Jan 29, 2018 at 11:10
  • 2
    May sounds stupid, but why is there a slash before your file name?! shouldn't it be 'image.png' and not /image.png'? Commented Jan 29, 2018 at 11:27

2 Answers 2

1

Preciel was totally right. Omitting the leading slash will make it work again. I'm just wondering why it works without a flaw on 2.8.

Thanks for the help :-)

Sign up to request clarification or add additional context in comments.

Comments

0

Could you post your config dump?

bin/console debug:config framework

It doesn't seem that anything has changed here. Also check the docs for base_path, if it's set right.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.