File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -216,17 +216,24 @@ public function editAction(): ?Action
216216
217217 $ action = Action::make ('edit ' )
218218 ->model (function (Action $ action , array $ arguments ) {
219- return $ this ->adapter ->getModelById ($ arguments ['record ' ])::class;
219+ return isset ( $ arguments [ ' record ' ]) ? $ this ->adapter ->getModelById ($ arguments ['record ' ])::class : null ;
220220 })
221221 ->record (function (array $ arguments ) {
222- return $ this ->adapter ->getModelById ($ arguments ['record ' ]);
222+ return isset ( $ arguments [ ' record ' ]) ? $ this ->adapter ->getModelById ($ arguments ['record ' ]) : null ;
223223 })
224224 ->fillForm (function (Action $ action , array $ arguments ) {
225+ if (!isset ($ arguments ['record ' ])) {
226+ return [];
227+ }
225228 $ record = $ this ->adapter ->getModelById ($ arguments ['record ' ]);
226229
227230 return $ record ->toArray ();
228231 })
229232 ->action (function (Action $ action , array $ arguments ) {
233+ if (!isset ($ arguments ['record ' ])) {
234+ return ;
235+ }
236+
230237 $ record = $ this ->adapter ->getModelById ($ arguments ['record ' ]);
231238 $ record ->fill ($ action ->getData ());
232239 $ record ->save ();
You can’t perform that action at this time.
0 commit comments