@@ -312,20 +312,13 @@ public function openCreateForm(string $columnId): void
312312 {
313313 $ this ->currentColumn = $ columnId ;
314314 $ this ->recordData = [];
315-
315+
316316 // Set the base model without filling yet
317317 $ this ->createRecordForm ->model ($ this ->adapter ->baseQuery ->getModel ());
318318
319319 // Pre-set the column field
320320 $ columnField = $ this ->config ->getColumnField ();
321321 $ this ->recordData [$ columnField ] = $ columnId ;
322-
323- // Apply any order field if needed
324- $ orderField = $ this ->config ->getOrderField ();
325- if ($ orderField !== null ) {
326- $ count = $ this ->getColumnItemsCount ($ columnId );
327- $ this ->recordData [$ orderField ] = $ count + 1 ;
328- }
329322 }
330323
331324 /**
@@ -352,13 +345,13 @@ public function openEditForm(string|int $recordId, string|int $columnId): void
352345
353346 // Set recordData first
354347 $ this ->recordData = $ record ->toArray ();
355-
348+
356349 // Clear form state to avoid reactivity issues
357350 $ this ->editRecordForm ->fill ([]);
358-
351+
359352 // Set the model on the form - this is crucial for relationships in nested components
360353 $ this ->editRecordForm ->model ($ record );
361-
354+
362355 // Now fill the form, which will allow nested components to initialize with the model's relationships
363356 // Using the model's data directly instead of recordData to avoid reactivity loops
364357 $ this ->editRecordForm ->fill ($ record ->toArray ());
@@ -378,7 +371,7 @@ public function createRecord(): void
378371 $ data [$ columnField ] = $ this ->currentColumn ;
379372 }
380373
381- $ card = $ this ->adapter ->createRecord ($ data );
374+ $ card = $ this ->adapter ->createRecord ($ data, $ this -> currentColumn );
382375
383376 if ($ card ) {
384377 $ this ->refreshBoard ();
@@ -407,7 +400,7 @@ private function resetCreateForm(): void
407400 {
408401 $ this ->recordData = [];
409402 $ this ->currentColumn = null ;
410-
403+
411404 // Just clear the form without chaining methods
412405 $ this ->createRecordForm ->fill ([]);
413406 }
@@ -459,7 +452,7 @@ public function resetEditForm(): void
459452 {
460453 $ this ->recordData = [];
461454 $ this ->currentRecord = null ;
462-
455+
463456 // Just clear the form without chaining methods
464457 $ this ->editRecordForm ->fill ([]);
465458 }
0 commit comments