Long story short, I stopped using the CDN module on a client's site because they transferred to a transparent cdn/cache/waf/proxy. So all static files are now being served off the www subdomain, same as the website.

Upon uninstalling CDN and rolling back the patches it makes to core I discovered this bug in advagg. When advagg bundles CSS files and rewrites the paths to the images inside, it calls file_create_url which, on an unpatched Drupal install will always prefix the path with "files/". This does not happen if your Drupal core is patched for the CDN module as the function is altered. So I am guessing that this was only ever tested by someone with the patch applied (even if CDN was disabled at the time), but I am surprised that no-one else has noticed this problem before.

For example, url(css/image.png) inside a stylesheet residing in a theme directory:

With the CDN patch applied is re-written to:
url(/sites/all/themes/atheme/css/image.png)

Without the patch, i.e. vanilla Drupal it re-writes to:
url(/files/sites/all/themes/atheme/css/image.png)

... and we have missing images all over the site.

The patch attached removes the call to file_create_url() but I am unsure if this will then break things for those people who do use the CDN module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, advagg.module.patch, failed testing.

mikeytown2’s picture

I would opt to bring in the pressflow version of file_create_url() call it advagg_file_create_url() so it will work with the CDN patch, core, or pressflow without issue.

My guess is everyone is using pressflow.

mikeytown2’s picture

Status: Needs work » Needs review
FileSize
3.65 KB

Here's a patch that uses pressflows version of file_create_ur

mikeytown2’s picture

Component: CSS/JS » Code
Status: Needs review » Fixed

Committed #3

  • mikeytown2 committed 39c6e26 on 6.x-1.x
    Issue #2456113 by mikeytown2: Use pressflow file_create_url function.
    

Status: Fixed » Closed (fixed)

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