When using the bundler with the fix paths option ('Fix improperly set type') enabled I am getting a ton of errors every time the css file is changed and the advagg cache is cleared.

It appears to mostly happen on paths that come from sites/default/files but what ends up happening to the urls is this

http:///sites/default/files/images/imagefilename.jpg

As you can see the domain was removed from the path to the image thus giving the browser a 404, and might I add this happens all over the pages and site that I am running. Could it be that the option for fixing the type is killing relative paths?

The only way we know for sure fixes this issues is by incrementing the advagg cache's global counter using the operations page under drastic measures. Would you happen to know what is going wrong here? I am tending to lean to the side of misconfiguration somewhere. Why would it start working again once the counter is incremented?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

  • mikeytown2 committed 86f9945 on 7.x-2.x
    Issue #2336217 by mikeytown2: Skip tripple slashes when fixing css/js...
mikeytown2’s picture

Version: 7.x-2.7 » 7.x-2.x-dev
Category: Bug report » Support request
Status: Active » Fixed
FileSize
5.38 KB

I would guess that when adding that file you're inadvertently including a double slash at the start. So instead of "/sites/default/files/images/imagefilename.jpg" you're using "//sites/default/files/images/imagefilename.jpg". AdvAgg sees this as a protocol relative url and converts it to external http://billpatrianakos.me/blog/2013/04/18/protocol-relative-urls/

I did add some logic so that if it contains 3 slashes it will skip over it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.