This is probably a PHP issue rather than a Drupal issue, but I just wanted to know if people is seeing this too.
In my system (apache 2.0.52, PHP 5.2.0, MySQL 5.0.22) I'm experiencing this issue: whenever I create a form element (an array) in which one of the keys of the elements doesn't start with # (as above), the apache process serving the page will die with a segmentation fault message.
Something like:
$form['foobar'] = array(
'#type' => 'textfield',
'foo' => 'bar',
'#default_value' => '0xdeadbeef',
);
drupal_get_form('foobar', $form);
The ( foo => bar ) will cause the PHP to crash (not exactly... but at least when I comment out this line, it works ok), so maybe it is something related to the new memory management, I don't know. If other people is experiencing this too, I'll forward this to PHP's bug tracking, and try to recreate a working trigger to be tested. I didn't dig enough to try to isolate it inside the forms subsystem or inside PHP's source code, so if anyone else already did it, let me know =)
Comments
nested array
If it's a property then it's #foo. If it's a child , then 'bar' needs to be an array as all form elements.
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | A teddy bear is a cuddle with four paws on the end.
--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.
I know
that, and I'm not questioning this (I just discovered that because of a typo, I forgot the #).
What I'm questioning is the segmentation fault problem on PHP, that isn't supposed to happen, never.
Got it ?
--
"Slackware users: Klingons of the computing world."
http://blogs.nshp.org/dsouza
Happening the same for me
I have drupal 5.0 and Apache 2.0.52 and it's happening the same but just when you call drupal_get_form, with the builtin forms there seems to be no problem.
For example if I set up a form for configuration it works, but when I want to make a custom form it faults in drupal_get_form call.
I am having this same problem.
We're theming comment_form and when it gets to the point in our custom XYZ_comment_form($edit,$title=null) where drupal_get_form() is called, we get a seg fault. Every time. Since this is happening with either our custom function or the comment_form() function lifted directly from comment.module, I'd assume it's a bug in 4.7's drupal_get_form(), and not in our theming.
Edit:I found that calling drupal_get_form() is a no-no in the theme_comment_form() as it creates a recursion (the usual reason for segfaults in PHP). I'm looking into other solutions for theming comment_form and will post a link in this thread.
http://thinkingman.com