Existing function _css_injector_rule_path() does not calculate path correctly if public file directory is outside of drupal instance and variable "file_public_path" is set to a symlink that points to that directory. The attached patch mitigates this issue.

Mukhsim.

Comments

Status: Needs review » Needs work

The last submitted patch, css_injector.filepath.retrieval.patch, failed testing.

rfay’s picture

Thanks for the patch.

Use git diff --no-prefix to generate your patch and it won't have the extra a/ and b/ that made this fail.

I didn't know that the public files directory could be outside the drupal directory. Under what circumstances would you do that?

mukhsim’s picture

Status: Needs work » Needs review
StatusFileSize
new883 bytes

Public files folder could be on a network share or separate file system for performance/security reasons.

Imagine having a dozen websites under multisite configuration. You might want to point files folder for each domain to a mount point which is both read and write, but keep everything else on a read-only partition.

A patch generated with --no-prefix is attached.
BTW, how do I get rid of "\ No newline at end of file" message in the patch file? Or is it supposed to be there?

Thanks,
Mukhsim.

rfay’s picture

Thanks!
I wouldn't worry about the "no newline at end of file" thing.

mukhsim’s picture

StatusFileSize
new697 bytes

Updated patch, checked out from CVS.

rfay’s picture

Status: Needs review » Postponed (maintainer needs more info)

I suspect that #1044670-12: Fix file handling resulting in Incorrect path to css file on Windows is a better solution for you. Could you please test it?

windmaomao’s picture

haven't try the patch yet, but after i migrate to multisite, css_injector is not working properly.

it just complains that the folder is not writable, but i wonder which folder it's asking right now. And i guess i have name conflict as well, since both sites has css_injector_1, and i don't think they have the same content right now. most likely one of the css_injector_1 is missing, which is understandable.

i wonder, css_injector probably can do something similar to cTools import/export, so that we don't need to worry too much about migration in the future. Sorry if i'm asking too much. This module rocks btw.

rfay’s picture

@windmaomao, please try 7.x-1.8 and see if it resolves your problem. The complaint in the status report was bogus and was fixed long, long ago, but never got into a release. But I just created 7.x-1.8.