Skip to content

containsOne - containsMany with unloaded model #452

@ibelar

Description

@ibelar

Form is now using this code to automatically set FormField/Multiline when containsOne - containsMany are used.

if ($f->type === 'array') {
            $limit = ($f->reference instanceof ContainsMany) ? 0 : 1;
            $model = $f->reference->refModel();
            $fallback_seed = ['MultiLine', 'model' => $model, 'rowLimit' => $limit, 'caption' => $model->getModelCaption()];
        }

However, ContainsMany::getDefaultPersistence($model) in atk4/data throws exceptions: 'model should be loaded.'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions