Closed (duplicate)
Project:
Drupal core
Version:
5.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2006 at 06:32 UTC
Updated:
1 Jul 2007 at 06:35 UTC
I need to programmatically set many forums.
It basically works, but I have a problem with the parent setting:
$values['name'] = 'test 11 Container name';
$values['description'] = 'This is my new forum';
$values['parent'] = '22';
$values['weight'] = '1';
drupal_execute('forum_form_container', $values);
When the parent < 10, it works as expected, but if parent >= 10, only the first digit of the parent is taken into account!
I.e., if parent = 15, the parent will be set as 1, and if parent = 22, it will be 2.
Comments
Comment #1
beginner commentedIf in this function:
function forum_form_submit($form_id, $form_values) {I do:
print_r($form_values);the substitution has already taken place.
Comment #2
cburschkaThis is not a bug. The parent field is represented by a select field in the form and therefore becomes an array:
The code has to pass an array as well:
Comment #3
beginner commentedOh my! Thanks.
I'll test that.
Comment #4
RobRoy commentedSee my post at http://drupal.org/node/106015 about why this doesn't work with nested taxonomy. Or maybe I'm missing something. That patch has turned into a bit more and I didn't have time to push it before the freeze.
Comment #5
beginner commentedI haven't had time to test what Arancaytar suggested, yet.
RobRoy seem to imply that this issue has been duplicated in the other one.