Mark uploaded_file element as required

Explictly set the required attribute of the uploaded_file element of BpUploadForm to true.
previously the resulting-html element was not required and submitting the form caused null being passed.
This is necessary because this class does not extend the Web\Form,
and the Zend_Form does not mark the elment as required.
This commit is contained in:
Bastian Lederer 2025-12-10 09:25:50 +01:00
parent 400ad69497
commit 71f0ea3878

View file

@ -142,6 +142,7 @@ class BpUploadForm extends BpConfigBaseForm
/** @var \Zend_Form_Element_File $el */
$el = $this->getElement('uploaded_file');
$el->setValueDisabled(true);
$el->setAttrib('required', true);
$this->setSubmitLabel(
$this->translate('Next')