File tree Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 7272 "minimum-stability" : " dev" ,
7373 "prefer-stable" : true ,
7474 "scripts" : {
75- "post-update-cmd" : [
76- " composer dump-autoload"
77- ],
7875 "analyze" : " phpstan analyze" ,
7976 "style" : " phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 src/ tests/" ,
8077 "test" : " phpunit"
Original file line number Diff line number Diff line change @@ -417,6 +417,7 @@ public function upload()
417417 // Check for more chunks
418418 if ($ chunkIndex < $ totalChunks - 1 )
419419 {
420+ session_write_close ();
420421 return '' ;
421422 }
422423
@@ -432,9 +433,13 @@ public function upload()
432433 // Accept the file
433434 $ file = $ this ->model ->createFromPath ($ path ?? $ upload ->getRealPath (), $ data );
434435
435- return $ this ->request ->isAJAX ()
436- ? ''
437- : redirect ()->back ()->with ('message ' , lang ('File.uploadSucces ' , [$ file ->clientname ]));;
436+ if ($ this ->request ->isAJAX ())
437+ {
438+ session_write_close ();
439+ return '' ;
440+ }
441+
442+ return redirect ()->back ()->with ('message ' , lang ('File.uploadSucces ' , [$ file ->clientname ]));
438443 }
439444
440445 /**
Original file line number Diff line number Diff line change 1010
1111 // Limit files to the MB equivalent of 500 chunks
1212 $ maxFileSize = round ($ chunkSize * 500 / 1024 / 1024 , 1 );
13- ?>
13+ ?>
1414 Dropzone.options.filesDropzone = {
1515
1616 // Reload file list after uploads
2222
2323 // Maximum file size in MB
2424 maxFilesize: <?= $ maxFileSize ?> ,
25-
26- // Disable parallel uploads
27- // (CodeIgniter4 Sessions chokes on interspersed AJAX calls)
28- parallelUploads: 1,
25+ timeout: 0,
2926
3027 // Enable chunking
3128 chunking: true,
Original file line number Diff line number Diff line change 6868 </div>
6969 </div>
7070
71+ <?= $ this ->endSection () ?>
72+ <?= $ this ->section ('footerAssets ' ) ?>
73+
7174 <?= view (config ('Files ' )->views ['dropzone ' ]) ?>
7275
7376<?= $ this ->endSection () ?>
Original file line number Diff line number Diff line change 33use CodeIgniter \Config \Factories ;
44use Config \Services ;
55use Tatter \Files \Models \FileModel ;
6+ use Tests \Support \Models \UserModel ;
67
78class FeatureTestCase extends FilesTestCase
89{
@@ -37,6 +38,9 @@ protected function setUp(): void
3738 parent ::setUp ();
3839
3940 $ this ->resetAuthServices ();
41+
42+ // Make sure we use the correct UserModel for permissions
43+ Factories::injectMock ('models ' , UserModel::class, new UserModel ());
4044 }
4145
4246 /**
You can’t perform that action at this time.
0 commit comments