This issue can be reproduce on windows servers with backslash as a folder separator.
You can see this in DJ-MegaMenu module where folderlist field is used for selecting theme
<field name="theme" type="folderlist" default="default" label="MOD_DJMEGAMENU_THEME" description="MOD_DJMEGAMENU_THEME_DESC" directory="modules/mod_djmegamenu/themes" hide_none="true" hide_default="true">
<option value="_override">MOD_DJMEGAMENU_THEME_OVERRIDE</option>
<option value="_custom">MOD_DJMEGAMENU_CUSTOM_THEME</option>
</field>
- override -
- custom -
classic
default
- override -
- custom -
C:\xampp\htdocs\joomla3\modules\mod_djmegamenu\themes/classic
C:\xampp\htdocs\joomla3\modules\mod_djmegamenu\themes/default
PHP 5.4.4
This can be fixed by replacing the 189 line in libraries/joomla/form/fields/folderlist.php file
$path = JPATH_ROOT . '/' . $path;
with
$path = JPath::clean(JPATH_ROOT . '/' . $path);
You also can use JPath::clean but with an additional parameter '/'
. Otherwise DIRECTRORY_SEPARATOR is used in clean(...).
$folder = JPath::clean(JPATH_ROOT . '/' . $folder , '/');
$folder = ...
@faugro
JPath::clean returns the server path to the folder, so it can contain backslashes or slashes depends on server UX.
The same $path is used as a starting point to find folders, then the $path is removed from folder paths, so how can you get backslashes in the returned folder list while JFolder::_items function use clean text slash and not DIRECTORY_SEPARATON ?
Is there anyone who can check this and create a pull request?
I've submitted a PR:
Anyone interested in getting this merged should test it, and report test results on the PR.
Closed as we have a PR for testing - thanks
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-25 08:29:21 |
Closed_By | ⇒ | brianteeman |
not solved the problem.
In my case the slash start change to backslash after line 204
so, for a while i add code to replace backslash to forwardslash on line 221, so it will be
I'm working on wamp in windows 7, have not test it on another environment yet.