mirror of
https://github.com/jbcr/core.git
synced 2026-04-24 00:58:09 +02:00
Don't break when creating a field with definition inconsistencies
This commit is contained in:
@@ -66,6 +66,14 @@ class FieldType extends Collection
|
||||
$definition = $contentType;
|
||||
|
||||
foreach ($parents as $parent) {
|
||||
|
||||
// This was here before due to extensions adding "services" as parent.
|
||||
// But also, it prevents breakage when there's inconsistencies between
|
||||
// the database and the definition. ¯\_(ツ)_/¯
|
||||
if (! $definition->get('fields')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$definition = $definition->get('fields')->get($parent, collect([]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user