2 replies [Last post]
elchony's picture
Offline
Joined: 07/04/2010
Juice: 13
Was this information Helpful?

I have a callback of an order_pane hook, which returns the string "Array" instead of the correct form in the 'edit-form' part of the switch. Any ideas of why?

Here is the code

function test_order_pane_callback($op, $arg1){

switch ($op) {

case 'edit-form' :

$form['info'] = array(
'#type' => 'fieldset',
'#title' => t("Info Adicional"),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['info']['tipo_producto'] = array(
'#type' => 'select',
'#title' => t('Tipo de productos'),
'#options' => $opciones,
'#required' => TRUE,
'#description' => 'Seleccione el tipo de producto que enviara. ',
'#weight' =>1,
'#default_value' => '',
'#multiple'=>'multiple',
);
return $form;
}
}

univate@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 03/27/2009
Juice: 465
are you trying to <?phpprint

are you trying to

<?php
print $form;
?>

As that will give you the string "Array", if you are want to view the contents of form:

<?php
print_r
($form);
?>
elchony's picture
Offline
Joined: 07/04/2010
Juice: 13
Fixed!

Hi Univate, thanks for the reply. I fixed the problem. Turns out that edit-form is fired when the form is buit, and edit-theme when it is shown, I hought it was edit-form tht showed the form, so RTFM for me!!

Anyway, I couldn't any documentation regarding this... does anyone know any good tutorial about this?