It appears that the elFinder setting that specifies absolute or relative paths isn't being honored.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | elfinder-honor_relative_path_setting-1710590-23.patch | 2.83 KB | bwaindwain |
It appears that the elFinder setting that specifies absolute or relative paths isn't being honored.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | elfinder-honor_relative_path_setting-1710590-23.patch | 2.83 KB | bwaindwain |
Comments
Comment #1
cravecode commentedI'm not sure if I've gone about this in the right way, however, I have put together a patch for what I think fixes the issue.
I added the following to the top of the elfinder_connect() function:
Comment #2
Anonymous (not verified) commentedThe patch also works for 6.x-2.x-dev. Thanks.
Comment #3
Poieo commentedNot sure if this is the proper fix, but it works for me.
Comment #4
jaroslaw.kaminski commentedWhy this patch is not in dev tree? I always have to use it to enable relative path in wysiwyg. It's almost year this patch waiting for acceptance.
Comment #5
ph0enix commentedComment #6
joelpittetThis patch totally does the trick. Nice work! Here's some nit picky things about the drupal coding standards that should be cleaned up. https://drupal.org/coding-standards
whitespace need on if statement. And Comment should be above if statement.
Extra whitespace in patch.
Comment #7
joelpittetIt looks as if there was some kind of half conversion from $mode = 'relative'/'absolute' to 'true'/'false' somewhere or the opposite maybe? The coding standards whitespace are really easy to fix and I'd likely RTBC this if it wasn't for this mode confusion. But by the looks of it should likely be storing 'relative'/'absolute' and passing through 'default' and checking for 'default' before looking up the elfinder_settings_filesystem_fileur.
Comment #8
cravecode commented@joelpittet, I don't understand your last two followups. Are you saying this patch no longer works?
Comment #9
joelpittet@cravecode First comment is about coding standards for the patch. Though that whole file needs coding standards cleanup...
Second is regarding the $mode variable not totally decided on what it is suppose to store. Some places it expects 'relative' or 'absolute' strings and other places it expects 'true' or 'false' strings. Not sure the direction it is intended to to be but it should be a bit more clear on what it should be containing.
Does that help clear up my review?
The patch works great, just want to make sure the fix is what it should be and the coding standards are followed.
Comment #10
cravecode commentedThanks, that clears it up for me. I've provided my contribution, I look forward to benefiting from yours.
Comment #11
joelpittet@cravecode not sure which direction the maintainers intended to go there. It looks like an incomplete thought in code... which is how the bug likely surfaced in the first place, so we'll likely have to wait until they have a peek.
Comment #12
cravecode commented@joelpittet, I completely agree, you were spot on when you stated that there seemed to be a mid-way switch from
true/falsetorelative/absolute. I'm also really curious why this hasn't been merged.Comment #13
cravecode commentedI updated the patch to work with the latest state of 7.x-2.x
Comment #14
cravecode commentedComment #15
misthero commentedi think this doesn't work if drupal is installed in a subfolder and not in main domain like test.com/drupal/
Comment #16
joelpittet@misthero What makes you say that did you try it? The patch doesn't change any path just makes the variable of value 'relative' actually pickup. For me this patch works but I'm not doing that subfolder stuff so maybe you can try it and let us know?
I'd recommend opening up a separate follow-up issue for that bug unless you can provide a patch that fixes that as well because I'd hate to prevent this patch from going in because we are waiting on a patch for a related but separate issue.
Comment #17
misthero commented@joelpittet, sorry, you are totally right, the problem is not your patch, it works and correctly detect 'relative' or absolute settings. And that is what is meant for.
The problem with relative urls being wrong when drupal is installed in a subfolder is NOT your patch fault!!
I fixed it in my installation calling the global $base_path; and than getting the url this way:
'URL' => $mode == 'relative' ? $base_path.$pubFiles->getDirectoryPath() ......
both for public o private files.
and sorry for the late answer but I didn't got notified, my bad.
Again: patch #13 works!
Comment #18
joelpittet@misthero thanks for giving it a try:) More eyes the better!
@ph0enix any chance you could weigh in on this?
Comment #19
delacosta456 commentedhi.
hi after searching for almost on month, this patch is the one that finally saved me.
thanks
Comment #20
rimen commentedPatch #13 works for public, private and unmanaged files only but not for volumes
We must replace
with
Comment #21
rimen commentedMoreover each volume has own filesystem_fileurl
I think it's more correct to define relative/external mode per volume config
Comment #22
bwaindwain commentedHere's a patch that incorporates #13, #17 and #21. Thanks everyone!
Comment #23
bwaindwain commentedfixed whitespace issue (this module needs some cleanup)
Comment #24
nwom commented#23 worked perfectly and applied cleanly. Thank you!
Comment #25
bwaindwain commentedComment #27
bwaindwain commentedComment #28
bwaindwain commented