Bug #7958
Widget selector display "? - ?" under windows
| Status: | Resolved | Start date: | 2010-05-28 | |
|---|---|---|---|---|
| Priority: | Must have | Due date: | ||
| Assignee: | Dmitry Dulepov | % Done: | 100% |
|
| Category: | Bug | |||
| Target version: | 0.9.1 | |||
| Votes: | 0 |
Description
Method getWidgetFolders use DIRECTORY_SEPARATOR (Linux = "/", Windows = "\").
This results in widgetname "? - ?" (only in Windows installation)
History
Updated by Dmitry Dulepov almost 3 years ago
- Status changed from New to Needs Feedback
- Priority changed from Should have to Won't have this time
Yes, it uses DIRECTORY_SEPARATOR. And?.. What's the problem with using DIRECTORY_SEPARATOR?
Please, describe it so that I do not have to use mind reading skills...
Updated by Juergen Furrer almost 3 years ago
DIRECTORY_SEPARATOR uses seperator from system.
Under Windows this is a backslash under Linux a slash (I like slash ;) )
Typo will make even the same seperator in Linux as in Windows.
The Problem is under Windows:
Path_From_Typo . DIRECTORY_SEPARATOR . "tabulator" = C:/virtual/typo3/typo3conf/ext\tabulator
PHP will interpret the \t as an tabulator (\n, \e) and this will result in an unknown path
Updated by Dmitry Dulepov almost 3 years ago
It does not work like that. If you write $str = '\t', it is a tab character. If you write $c = '\\'; $str = $c . 't', it is not a tab character but a slash followed by a 't' character. It is PHP basics.
Updated by Dmitry Dulepov almost 3 years ago
The real problem seems to in t3lib_div::getFileAbsFileName(), which hard-codes a forward slash as a separator. Thus language file with valid Windows path separator cannot be read. If your idea was right, you would not even see "? - ?" because the directory with widgets would not be found:
$dir = opendir($searchInFolder);
while (($file = readdir($dir)) !== false) {
if ($file{0} != '.') {
$testPath = $searchInFolder . DIRECTORY_SEPARATOR . $file;
if (is_dir($testPath) && file_exists($testPath . DIRECTORY_SEPARATOR . 'locallang.xml')) {
$files[$file] = $testPath;
}
}
}
closedir($dir);
Updated by Dmitry Dulepov almost 3 years ago
- Category set to Bug
- Status changed from Needs Feedback to Resolved
- Assignee set to Dmitry Dulepov
- Priority changed from Won't have this time to Must have
- Target version set to 0.9.1
- % Done changed from 0 to 100
rev 34016