Upload field type in Config pages


I am trying to add a config page from the tutorial


The field definition in fields.yaml is

            label: 'File upload'
            span: auto
            mode: file
            useCaption: true
                mode: crop
                extension: auto
            type: fileupload

However the upload type is not working in this.

I have also added the relation in the model as

    public $attachOne = [
        'intro_image' => 'System\Models\File'

but still there is the follwoing error

Call to undefined method My\Settings\Controllers\MySettingsController::hasRelation()

I know it has not database value to relate to but there is a key defined in MySettings::get(‘value’). Is there any possibility to relate this value to the upload image $attachOne relationship?

Thank you in advance.

It’s not clear from this post why this is happening. We would need to see the full stack trace to understand where the error comes from.