In our environment we have a site installed at example.com and another one installed at example.com/internal.
drimage shows the wrong image (or none at all if a file with that id doesn't exist) at example.com/internal because it gets the image from /drimage/{width}/{height}/{fid}/{filename}, so it fetches an image from example.com.
I have created a patch which adds the subdirectory if the site if there is one.
If not, then feel free to set back to "needs review" and I'll include it.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | drimage-add_subdir_to_path-3152008-6.patch | 9.39 KB | emek |
Comments
Comment #2
emek commentedHere is the patch.
Comment #3
weseze commentedPatch looks functionally good to me, but doesn't Drupal have a specific name for this part of the URL? I'd like to stick to Drupal-wording...
Comment #4
emek commentedI don't know, when looking at the documentation for multisites the only thing I find is subdirectory, https://www.drupal.org/docs/7/multisite-drupal/multi-site-in-subdirectories
Comment #5
weseze commentedThe patch does not work with multilingual setup.
The resulting URL looks like /{LANGUAGE}drimage/... A slash seems to be missing. I would assume the same issue is present for subdirectories?
Comment #6
emek commentedI have updated the patch.
It seems as when the site is multilingual the $url variable doesn't end in a slash (which it did for my subdir sites). I have added a / between the parts in the js and added a check in the php code if the variable ends in a / and if it does it is removed.
It still works on my local sites. Hopefully it will work on your multilingual sites as well.
Comment #9
weseze commentedLooking good now. Committed and should become available in 2.0.1 release.