symfony-cmf / media-bundle

UNMAINTAINED - Minimalistic interfaces to handle media in the context of the CMF
http://cmf.symfony.com/
30 stars 40 forks source link

Path contains backslash when adding folder using elfinder #89

Closed webberig closed 10 years ago

webberig commented 10 years ago

I installed the mediabundle and configured the elfinder adapter, but when I add a folder, it doesn't display it. When I look at the database, it's being added but the path name contains backslashes, eg. /cms/media\test.

I suppose this hasn't been tested on a Windows machine ? :-)

rmsint commented 10 years ago

Hmmm, nope this has not been tested on windows. However we did took windows into account, to prevent issue with slashes etc. like this.

My first guess would be that it is caused by the elfinder adapter: https://github.com/symfony-cmf/MediaBundle/blob/master/Adapter/ElFinder/PhpcrDriver.php

In the code I see that the DIRECTORY_SEPERATOR is used, I guess this will be a "\" on windows.

webberig commented 10 years ago

Yes, the constant defines the seperator of the filesystem which is a backspace. I suppose you can use a hardcoded slash for this since phpcr always uses a slash ?

I'll provide a pull request soon, there are some other issues with the adapter.

Op zaterdag 28 december 2013 schreef Roel Sint (notifications@github.com):

Hmmm, nope this has not been tested on windows. However we did took windows into account, to prevent issue with slashes etc. like this.

My first guess would be that it is caused by the elfinder adapter: https://github.com/symfony-cmf/MediaBundle/blob/master/Adapter/ElFinder/PhpcrDriver.php

In the code I see that the DIRECTORY_SEPERATOR is used, I guess this will be a "\" on windows.

— Reply to this email directly or view it on GitHubhttps://github.com/symfony-cmf/MediaBundle/issues/89#issuecomment-31304278 .

rmsint commented 10 years ago

Yes a hardcoded slash can be used. Thanks for tracking some issues, looking forward to your PR.

dbu commented 10 years ago

yep, hardcoded / is what should be used. PHPCR defines that as standard separator, not OS dependent. i guess the mistake happened when converting a filesystem adaptor to PHPCR. great if you can fix that.