File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
plugins/bc-custom-content/src/Service/Front Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -364,11 +364,17 @@ public function setupPreviewForView(Controller $controller): void
364364 }
365365
366366 $ events = BcUtil::offEvent ($ customEntriesTable ->getEventManager (), 'Model.beforeMarshal ' );
367- $ entity = $ customEntriesTable ->saveTmpFiles ($ postEntity , mt_rand (0 , 99999999 ));
367+
368+ if ($ postEntity && $ customEntriesTable ->hasBehavior ('BcUpload ' )) {
369+ // BcUpload ビヘイビアがある場合は、アップロードファイルを保存
370+ $ entity = $ customEntriesTable ->saveTmpFiles ($ postEntity , mt_rand (0 , 99999999 ));
371+ $ postEntity = $ entity ->toArray ();
372+ }
368373 $ entity = $ customEntriesTable ->patchEntity (
369374 $ customEntry ?? $ customEntriesTable ->newEmptyEntity (),
370- ( $ postEntity)? $ entity -> toArray (): []
375+ $ postEntity
371376 );
377+
372378 BcUtil::onEvent ($ customEntriesTable ->getEventManager (), 'Model.beforeMarshal ' , $ events );
373379
374380 $ entity = $ customEntriesTable ->decodeRow ($ entity );
You can’t perform that action at this time.
0 commit comments