-
Notifications
You must be signed in to change notification settings - Fork 732
Move File Only Shows 1 Level of Sub-Directories #1179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Has anyone found a workaround to get these subdirectories displayed on the side menu ? |
Topic 1 : missing destination sub-foldersI confirm that I have the same problem on Windows 11. I see that this is due to the way it has been implemented in As one can see, it only looks for the children of one level and doesn't do it recursively. By the way, this view has quite a lot of problems:
A first improvement, to have valid HTML, but not yet with recursion for the sub-folders: <ul class="nav nav-pills flex-column">
@foreach($root_folders as $root_folder)
<li class="nav-item">
<a class="nav-link" href="#" data-type="0" onclick="moveToNewFolder(`{{ $root_folder->url }}`)">
<i class="fa fa-folder fa-fw"></i> {{ $root_folder->name }}
<input type="hidden" name="goToFolder" value="{{ $root_folder->url }}">
</a>
</li>
@foreach($root_folder->children as $directory)
<li class="nav-item sub-item">
<a class="nav-link" href="#" data-type="0" onclick="moveToNewFolder(`{{ $directory->url }}`)">
<i class="fa fa-folder fa-fw"></i> {{ $directory->name }}
<input type="hidden" name="goToFolder" value="{{ $directory->url }}">
</a>
</li>
@endforeach
@endforeach
</ul>
<div id="items-to-move">
@foreach($items as $i => $item)
<input type="hidden" id="item-to-move-{{ $i }}" name="items[]" value="{{ $item }}">
@endforeach
</div>
<script>
function moveToNewFolder(folder) {
$("#notify").modal('hide');
let items = [];
$("#items-to-move").find("input").each(function() {items.push(this.value)});
performLfmRequest('domove', {
items: items,
goToFolder: folder
}).done(refreshFoldersAndItems);
}
</script> It should be possible to create a sub-template inside the I'll try to make one and refactor the Topic 2 : error 500 when doing the move operation, on WindowsWhen selecting a folder, the browser will initiate the move operation, which will trigger the Debugging the PHP code, I found out that it is crashing here: laravel-filemanager/src/Lfm.php Line 237 in e82f8f6
This is because the
The crash only happens on Windows because the conversion from UTF-8 is only done on this system. I'm not really sure how to refactor this code properly, but it would perhaps be possible to rewrite the /**
* Translate file or directory name(s) to be compatible on Windows.
*
* @param string|array $input Any string or array of strings.
* @return string|array
*/
public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
if (is_array($input)) {
foreach ($input as &$item) {
$item = iconv('UTF-8', mb_detect_encoding($item), $item);
}
} else {
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
}
}
return $input;
} I made pull request #1260 to fix it with the code above. |
Operating system
Windows 10
Laravel version
7:30.6
Package version
2.5.1
Steps to reproduce your issue
The text was updated successfully, but these errors were encountered: