I have been trying to figure this out for over an hour and I have made no progress...
I have the following form and its the only field:
<?php
$builder
->add('cars', 'collection', array(
'type' => new CarType(),
//'property_path' => '[cars]',
'required' => false,
))
;
This form receives an array, with one key "cars" pointing to an array of Car objects (which are handled fine by the CarType().
When I set data to this form, it gives me a Property Path parse error, stating that the property path "[]" is invalid and cant be parsed. Note that if I uncomment the property_path option above it is the same error (I just put that there to show its the default).
- Why is it using a property path of []?
- How can I fix this?
NOTE: This works fine in one enviornment with PHP 5.4 and fails on all my PHP 5.3 environments.
Thanks for any help.
More information:
Exception: "Could not parse property path "[]". Unexpected token "[" at position 0"
in /vagrant/vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyPath.php at line 125