Use the field type on the custom form

Created on 23 August 2023, 10 months ago
Updated 5 September 2023, 10 months ago

Problem/Motivation

I need to create a custom form and save data on Google Storage.

<?php
$form['step3']['file'] = [
      '#type' => 'flysystem_gcs_cors_file',
      '#upload_location' => 'cloud-storage://2023-08',
      '#upload_validators' => [
        'file_validate_extensions' => ['pdf'],
      ],
      '#title' => $this->t('File'),
      '#required' => TRUE,
];
?>

But the field only works inside the entity.

Steps to reproduce

Create a custom form with the field type:
'#type' => 'flysystem_gcs_cors_file',

Proposed resolution

The field needs to understand when it's not inside an entity. With that, just upload and send the link to submit the form.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil edmargomes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024