Closed (outdated)
Project:
Drupal core
Version:
6.22
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2011 at 21:02 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent
Comments
Comment #1
benstallings commentedI'm assuming you mean
Thanks for the tip!
Comment #2
raggax2 commentedI'm not sure this is something that needs to be addressed in core.
The whole point of this function is to recursively set form_state['values'] while keeping consistent with nested elements in the form tree. According to the comments in the code the helper function is to handle the case of:
With the corresponding form tree having the attribute:
From what I can tell, the recursive call to _form_set_value() on line 1346 should only execute if $form_values[$parent] is an array. If $parent is a leaf in that section of the array, then the value should be set on line 1340. Your proposed fix implies that $form_values[$parent] is a literal of some sort and the function is trying to pass it as an array. My intuition tells me that this error is most likely the result of the form array not being configured correctly. It sounds like there may be a form array that looks something like this:
In this case, form_set_value would set the $form_state['values']['one'] with a literal value and then try and pass $form_state['values']['one'] into the recursive call in 1346, resulting in the error you see, rather than setting $form_state['values']['one'] as an array to produce $form_state['values']['one']['two']'.
Can you provide an example $form array that produces this error?