Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
I have put / as the default folder (I am guessing this means the files folder, even though it's bit cloudy.:)
I see the sub folders when I start IMCE in text-only content page (no WYSIWIG editor). But I can't navigate them. Then I select a sub folder from the drop down menu, the pop-up windows reloads and "thinks" but ends up in the files folder where I started.
Comment | File | Size | Author |
---|---|---|---|
#12 | imce.module_1.patch | 1.16 KB | ufku |
#10 | imce.module_0.patch | 1.18 KB | ufku |
#3 | imce.module.slash_.patch | 744 bytes | ufku |
Comments
Comment #1
ufku CreditAttribution: ufku commentedyes "/" means your files directory.
your bug report is what a bug report shouldn't be :)
isn't there any specific point you want to share?
tested with different browsers? with any starting folder other than main folder? with a different user?
see any javascript errors? created folders with sub-folder tool?...
Comment #2
Boletus CreditAttribution: Boletus commentedTested with Opera 9.01, Firefox 2.01 and IE 6. Windows XP sp2.
No javascript errors as I can see.
I've tried to enter a subfolder in the settings. It works, but I can't navigate upwards.
I have not created the subfolders in the IMCE settings. Could that be a factor?
Comment #3
ufku CreditAttribution: ufku commentedmanually created directories could be problematic but the error wouldnt be silent. i think there is a problem with that cloudy slash situation.
please try the patch that handles it in a more correct way.
Comment #4
Boletus CreditAttribution: Boletus commentedI'm not that good with patches. Could you talk me through it? At what line should I change the code?
Comment #5
Boletus CreditAttribution: Boletus commentedI added the line, as below. And commented out the original line. Is that correct?
I still can't navigate sub-menus. Am I supposed to change anything in the IMCE settings?
Comment #6
ufku CreditAttribution: ufku commentedyes it removes the extra // from the end of the directory name. the slashes are harmless in general but i thought yours was a special case. i was wrong.
can you send me the html sources of your main imce pages when you set the folder to / and when you set the folder to any subdirectory.
in the meantime you can check if there is any difference when you change your file download method(private-public switch) and when you login with a different user whose main folder is /.
Comment #7
Boletus CreditAttribution: Boletus commentedSorry, I forgot to subscribe to this issue. I did not see your answer until now. I'll send you the code as soon as I can.
Comment #8
Boletus CreditAttribution: Boletus commentedI been up to my neck in work. Sorry. I moved my drupal installation from a subfolder www.example.com/drupal/ to www.example.com. Now the subfolder navigation IMCE works. I don't know if that is a clue or not?
Comment #9
Boletus CreditAttribution: Boletus commentedBy the way, I did not change any of the IMCE settings after I moved the site.
Can it have to do something with the Base URL (optional) in the settings.php file for the site? I didn't enable that URL.
Comment #10
ufku CreditAttribution: ufku commentedsubfolder installation was the key to the bug. yes you found it. IMCE used $_SERVER['DOCUMENT_ROOT'] variable to get the relative file path, which results in an incorrect path with a sufolder installation. Now the relative path is obtained using the script path.
I'll commit the attached patch if you confirm the problem is over.
(Patch replaces line 787 with
$root = str_replace('\\', '/', ($root ? realpath($root) : dirname($_SERVER['SCRIPT_FILENAME'])));
)Comment #11
ufku CreditAttribution: ufku commentedComment #12
ufku CreditAttribution: ufku commentedadded missing realpath.
Comment #13
ufku CreditAttribution: ufku commentedcommited.
Comment #14
(not verified) CreditAttribution: commented