trash fixed

This commit is contained in:
Peter Papp
2021-03-16 10:30:36 +01:00
parent f3783e6f98
commit adbe35e8b5
4 changed files with 9 additions and 5 deletions

View File

@@ -184,6 +184,7 @@ class SetupDevEnvironment extends Command
->create([
'type' => 'folder',
'item_id' => $shared_folder->id,
'user_id' => $user->id,
'permission' => 'editor',
'is_protected' => false,
'password' => null,
@@ -318,6 +319,7 @@ class SetupDevEnvironment extends Command
->create([
'type' => 'folder',
'item_id' => $documents->id,
'user_id' => $user->id,
'permission' => 'editor',
'is_protected' => false,
'password' => null,
@@ -722,7 +724,7 @@ class SetupDevEnvironment extends Command
],
[
'name' => 'app_favicon',
'value' => null,
'value' => 'system/favicon.png',
],
[
'name' => 'google_analytics',
@@ -764,7 +766,7 @@ class SetupDevEnvironment extends Command
});
// Get system images
collect(['logo.svg', 'logo-horizontal.svg'])
collect(['logo.svg', 'logo-horizontal.svg', 'favicon.png'])
->each(function ($file) {
\File::copy(storage_path("demo/app/$file"), storage_path("app/system/$file"));
});

View File

@@ -105,8 +105,10 @@ class BrowseController extends Controller
$files_trashed = File::onlyTrashed()
->with(['parent'])
->where('user_id', $user_id)
->whereNull('folder_id')
->orWhereNotIn('folder_id', array_values(array_unique(recursiveFind($folders_trashed->toArray(), 'id'))))
->where(function($query) use ($folders_trashed) {
$query->whereNull('folder_id');
$query->orWhereNotIn('folder_id', array_values(array_unique(recursiveFind($folders_trashed->toArray(), 'id'))));
})
->sortable()
->get();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -338,8 +338,8 @@ class BrowseTest extends TestCase
'parent_id' => null,
'name' => 'root',
'user_id' => $user->id,
'deleted_at' => Carbon::now(),
"user_scope" => "master",
'deleted_at' => Carbon::now(),
]);
$file = File::factory(File::class)