Icinga / ipl-html

HTML abstraction layer for the Icinga PHP Library
MIT License
1 stars 1 forks source link

`FileElement` does not preserve multiple uploads #126

Closed nilmerg closed 1 year ago

nilmerg commented 1 year ago

To reproduce:

        $form = new class extends CompatForm {
            protected function assemble()
            {
                $this->setAttribute('enctype', 'multipart/form-data');
                $this->addElement('checkbox', 'checkbox', [
                    'class' => 'autosubmit',
                    'label' => 'A decision'
                ]);
                $this->addElement('text', 'text', [
                    'label' => 'Some text'
                ]);
                $this->addElement('file', 'file', [
                    'label' => 'A file',
                    'description' => 'Really, it is a file',
                    'accept' => ['image/*', '.png', '.jpg'],
                    'capture' => 'user',
                    'destination' => sys_get_temp_dir(),
                    'multiple' => true
                ]);
                $this->addElement('submit', 'submit', [
                    'label' => 'Submit'
                ]);
            }
        };

        $form->handleRequest($this->getServerRequest());
nilmerg commented 1 year ago

Broken since https://github.com/Icinga/ipl-html/pull/117/commits/40ffb81a1b62a2001f902002358900375a7d244b