Laminas $filter->getValues() in getData() of laminas-form return duplicate of array collection when using Element File

34 Views Asked by At

Hi i'm using laminas and i create dynamic forms collection with Element File, and other elements. After submit, i recreate form using "inizializzaForm" function and it works, but when i try to get all data, my subform was an array duplicated with second array empty and only record of file valorized.

In laminas code ("laminas-form\src\Form.php") i've found this istruction $filter->getValues() that return this

...
...
'salva' => string 'SALVA' (length=5)
  'salva_rimani' => null
  'documento_1703782109335' => 
    array (size=2)
      0 => 
        array (size=10)
          'titolo' => string '1111' (length=4)
          'allegato_tmp' => string '' (length=0)
          'allegato_old' => string '' (length=0)
          'uniqid' => string 'documento_1703782109335' (length=23)
          'idDocumento' => string '' (length=0)
          'module' => string 'Utenti' (length=6)
          'related_id' => string '' (length=0)
          'allegato' => null
          'data_scadenza' => null
          'elimina' => null
      1 => 
        array (size=10)
          'titolo' => null
          'allegato_tmp' => null
          'allegato_old' => null
          'uniqid' => null
          'idDocumento' => null
          'module' => null
          'related_id' => null
          'allegato' => 
            array (size=5)
              ...
          'data_scadenza' => null
          'elimina' => null

if i use var_dump($this->data) in "laminas-form\src\Form.php" before return $filter->getValues(); i recive correct array:

...
...
'documento_1703782109335' => 
    array (size=2)
      0 => 
        array (size=8)
          'titolo' => string '1111' (length=4)
          'data_scadenza' => string '' (length=0)
          'allegato_tmp' => string '' (length=0)
          'allegato_old' => string '' (length=0)
          'uniqid' => string 'documento_1703782109335' (length=23)
          'idDocumento' => string '' (length=0)
          'module' => string 'Utenti' (length=6)
          'related_id' => string '' (length=0)
      1 => 
        array (size=1)
          'allegato' => 
            array (size=5)
              ...




i try var_dump in "laminas-form\src\Form.php"

0

There are 0 best solutions below