I'm not sure if I should have posted this issue in the CDN project, FileField Sources or IMCE project.

I'm currently using FileField Sources with IMCE. I have it setup so I can upload new images or browse my server for existing images. After installing the CDN module, I am no longer able to browse for existing images. If I browse, it shows the file names, but when I click them I don't get a preview. If I select one of the images and click insert, I get an error "The selected file could not be used because the file does not exist in the database."

I am still able to upload new images and everything works fine.

Any help would be appreciated. Thanks!

### UPDATE ###
The functionality of IMCE seems to work fine. After using inspector, I realized that the image files that wont preview have an invalid src property in the <img> tag.

It seems as though this is only a problem when utilizing the "far future expiration" setting.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bmblack’s picture

Project: CDN » IMCE
Issue summary: View changes

UPDATE

Wim Leers’s picture

Title: IMCE breaks after installing CDN » IMCE + CDN compatibility
Project: IMCE » CDN
Category: bug » task
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

IMCE should use hook_cdn_blacklist() to blacklist its JS files: http://drupalcode.org/project/cdn.git/blob/0f19fca6c4c382cdd751ac97346c0....

If not, then it should work around the cross-origin domain policy.

Wim Leers’s picture

Project: CDN » IMCE
Version: 7.x-2.5 » 7.x-1.5
Component: Origin Pull mode » Code
Status: Postponed (maintainer needs more info) » Active

Moving to IMCE issue queue.

dazz’s picture

I added these paths to the blacklist but it doesn't seem to fix it.

sites/all/modules/contrib/imce/js/*
sites/all/modules/contrib/imce_wysiwyg/js/*
lorenzods’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Category: task » bug
Priority: Minor » Normal
Status: Active » Needs review
FileSize
5.68 KB

This patch works on branch 7.x-1.x-dev (for CDN far future compatibility)

lorenzods’s picture

FileSize
5.68 KB

This patch fixes CDN interaction with far future option enabled.

lorenzods’s picture

Issue summary: View changes

update

bloomt’s picture

Issue summary: View changes

Can someone help me with this issue? The patch does not apply cleanly for me.

bloomt’s picture

FileSize
5.67 KB

I updated the patch so that it will apply cleanly to the latest version of IMCE-7.x-1.x-dev

joelpittet’s picture

Status: Needs review » Needs work

This looks like it fixes a bunch of things, are all of these things needed for the CDN compatibility?

+++ b/js/imce.js
@@ -104,8 +104,19 @@ dirSubdirs: function(dir, subdirs) {
+	// load from initial config
+	if (imce.conf.files_obj) {

@@ -131,8 +142,9 @@ initiateList: function(cached) {
+		imce.files_obj[fid]=file;

Unusual whitespace in this patch.
Maybe you are using tabs instead of 2 spaces?
Also need spaces around the " = " sign. And comments should start with a captital and end with a period for coding standards.

@see https://www.drupal.org/coding-standards#indenting

joelpittet’s picture

Heads up adding it to the variable cdn_exception_drupal_path_blacklist fixed it for me. Which is in the UI under the page /admin/config/development/cdn/other as Exceptions > Drupal Path

And I just added imce* to that list.
Hope that helps someone.

ufku’s picture

Category: Bug report » Feature request
Status: Needs work » Closed (won't fix)

Closing as per the blacklist workaround.