iwyg / filemanager

Filemanager for Symphony CMS
13 stars 11 forks source link

Issue when adding entries on a Windows/wamp installation, and later running them on a Unix machine #25

Closed kanduvisla closed 11 years ago

kanduvisla commented 11 years ago

On a Windows/Wamp installation, paths get stored with a backslash. This renders the images to be unfindable in Unix environments.

I tried changing the code so the backslash gets saved as a forward slash, but then I can't see the image in the backend. The frontend however works then...

kanduvisla commented 11 years ago

Hmm... it appears that some JavaScript code in the backend is removing the LI-element from the select-list. So at first the file is there, but then it gets removed.

Since the JS is minified I can't seem to find the problem so soon... but it's a pointer

kanduvisla commented 11 years ago

Aha, it was the input in the JS, not the JS itself that was causing issues:

Adding the following line in the foreach-loop in the processRawFieldData()-function in field.filemanager.php (around line 590):

$data['file'][$i] = $file = str_replace('\\', '/', $file);

and editing class.directorytools.php the _getFileInfo()-function the return-array (around line 216) to:

'path' => str_replace('\\', '/', $path),

fixed it for me. Not sure if the str_replace()-function is the best way to change backslashes to forward slashes, but this is a quick fix. I hope this gets fixed in the next release

iwyg commented 11 years ago

isn't that exactly the same issue than this?