octobercms/october · error · SystemException
Invalid field type used :type.
Error message
Invalid field type used :type.
What it means
Type guard in makeFormField: after building the FormField, it inspects config['type'] and requires it to be either a string or null. A non-string type (e.g. an array, object, or number sneaking in from malformed YAML/PHP config) fails the check, because the field type is used to resolve a form control partial by name and only strings can be looked up.
Solutions
- Fix the field definition so its 'type' key is a plain string (e.g. 'text', 'dropdown')
- Remove the 'type' key entirely to fall back to the default field type
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at modules/backend/widgets/Form.php:930 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/1d2145ac35256d14.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/widgets/Form.php:930
$field = new FormField([
'fieldName' => $fieldName,
'label' => $label,
'arrayName' => $this->arrayName,
'idPrefix' => $this->getId()
]);
if ($fieldContext) {
$field->context($fieldContext);
}
if (is_string($config)) {
$field->displayAs($config);
}
else {
$fieldType = $config['type'] ?? null;
if (!is_string($fieldType) && $fieldType !== null) {
throw new SystemException(Lang::get(
'backend::lang.field.invalid_type',
['type' => gettype($fieldType)]
));
}
if ($config) {
$field->useConfig($config);
}
if ($fieldType) {
$field->displayAs($fieldType);
}
}
return $field;
}
/**View on GitHub (pinned to b608633a7e)