[Flow] How to add new child objects from a form

Axel Wüstemann awu at qbus.de
Fri Jan 17 15:50:45 CET 2014


Hello,

in my form I have a parent object and n children. I add chield rows with 
jQuery.

I get the error
#1335969887: It is not allowed to map property "3". You need to use 
$propertyMappingConfiguration->allowProperties('3') to enable mapping of 
this property.

one child element in the form goes like this in the html source

<input type="hidden" name="depositInspection[deposits][0][id]" 
value="89752" />
<select id="item-0-deposit" 
name="depositInspection[deposits][0][deposit]">...</select>
<input id="item-0-amount" type="text" 
name="depositInspection[deposits][0][amount]" value="900" />

depositInspection is the parent and deposits are the children.

debugging the propertyMapper loop (Line 162) I get

deposits
array(4)
  integer 0 => array(3)
    'id' (2) => '89752' (5)
    'deposit' (7) => 'Flunder 1' (9)
    'amount' (6) => '900' (3)
  integer 1 => array(3)
    'id' (2) => '89742' (5)
    'deposit' (7) => 'Dorsch uns.' (11)
    'amount' (6) => '300' (3)
  integer 2 => array(3)
    'id' (2) => '89762' (5)
    'deposit' (7) => 'Scholle 1' (9)
    'amount' (6) => '249' (3)
  integer 3 => array(3)
    'id' (2) => '' (0)
    'deposit' (7) => '' (0)
    'amount' (6) => '200' (3)

0
array(3)
  'id' (2) => '89752' (5)
  'deposit' (7) => 'Flunder 1' (9)
  'amount' (6) => '900' (3)
id
'89752' (5)
deposit
'Flunder 1' (9)
...
...

3
array(3)
  'id' (2) => '' (0)
  'deposit' (7) => '' (0)
  'amount' (6) => '200' (3)

==> here comes the error, on the newly created element because it is not 
yet added to the deposits property of the parent

How I need to construct such a scenario?

Thanks
Axel





More information about the Flow mailing list