{"record":{"id":"1d2145ac35256d14","repo":"octobercms/october","slug":"invalid-field-type-used-type","errorCode":null,"errorMessage":"Invalid field type used :type.","messagePattern":"Invalid field type used :type\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/backend/widgets/Form.php","lineNumber":930,"sourceCode":"\n        $field = new FormField([\n            'fieldName' => $fieldName,\n            'label' => $label,\n            'arrayName' => $this->arrayName,\n            'idPrefix' => $this->getId()\n        ]);\n\n        if ($fieldContext) {\n            $field->context($fieldContext);\n        }\n\n        if (is_string($config)) {\n            $field->displayAs($config);\n        }\n        else {\n            $fieldType = $config['type'] ?? null;\n            if (!is_string($fieldType) && $fieldType !== null) {\n                throw new SystemException(Lang::get(\n                    'backend::lang.field.invalid_type',\n                    ['type' => gettype($fieldType)]\n                ));\n            }\n\n            if ($config) {\n                $field->useConfig($config);\n            }\n\n            if ($fieldType) {\n                $field->displayAs($fieldType);\n            }\n        }\n\n        return $field;\n    }\n\n    /**","sourceCodeStart":912,"sourceCodeEnd":948,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/widgets/Form.php#L912-L948","documentation":"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.","triggerScenarios":"Thrown at modules/backend/widgets/Form.php:930 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}