You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The hasFile() function is designed to determine if a form includes file fields and applies the necessary enctype="multipart/form-data" attribute. However, it only checks for fields that are instances of Field\File or Field\MultipleFile.
I have implemented a custom file uploader with cropping functionality. Since my custom fields do not extend from either of the expected classes (Field\File or Field\MultipleFile), the hasFile() function fails to recognize them as file upload fields. Consequently, the form does not receive the correct enctype attribute, causing the file uploads to fail.
Proposed Solution
Allow hasFile() to be extensible or configurable so that it can detect custom file fields. Example: if ( $field instanceof Field\File || $field instanceof Field\MultipleFile || ( method_exists($field, 'isFileField') && $field->isFileField() ) ) {
The text was updated successfully, but these errors were encountered:
https://github.com/open-admin-org/open-admin/blob/dc6206d9f7ce3b59a80994828dea540460108791/src/Form/Builder.php#L452C13-L452C86
Description
The hasFile() function is designed to determine if a form includes file fields and applies the necessary enctype="multipart/form-data" attribute. However, it only checks for fields that are instances of Field\File or Field\MultipleFile.
I have implemented a custom file uploader with cropping functionality. Since my custom fields do not extend from either of the expected classes (Field\File or Field\MultipleFile), the hasFile() function fails to recognize them as file upload fields. Consequently, the form does not receive the correct enctype attribute, causing the file uploads to fail.
Proposed Solution
Allow hasFile() to be extensible or configurable so that it can detect custom file fields. Example:
if ( $field instanceof Field\File || $field instanceof Field\MultipleFile || ( method_exists($field, 'isFileField') && $field->isFileField() ) ) {
The text was updated successfully, but these errors were encountered: