Hi, i´m developing a module like node reference but different. My problem is that I get an array with de values, but when using that values with default_values on the select, it doesn´t work. I try EVERITHING.
Could anyone get an idea, of wht'a happend ? Thank´s a lot and excuse for the english.
<?php
function miartrel_menu($may_cache) {
$items = array();
if ($may_cache) {
// ...
} else {
$items[] = array(
'path' => 'node/' .arg(1). '/miartrel',
'title' => t('MiArtRel'),
'callback' => 'miartrel_nodeapi',
'callback arguments' => array($node),
'type' => MENU_LOCAL_TASK,
);
}
return $items;
}
function miartrel_nodeapi(&$node) {
$imprimir .= drupal_get_form('miartrel_form', $node);
return $imprimir;
}
//////////////////////////////////////////
/**
* Defines a form.
*/
function traerArtVinc ($node) {
$opciones = db_query("SELECT field_artculos_vinculados_nid FROM {content_field_artculos_vinculados} WHERE nid = %d", $node->nid);
$z = 0;
while ($op = db_fetch_object($opciones)) {
$opciones_default[$z] = (int) $op->field_artculos_vinculados_nid;
$z++;
}
return $opciones_default;
}
function miartrel_form($node) {
$opciones = db_query("SELECT field_artculos_vinculados_nid FROM {content_field_artculos_vinculados} WHERE nid = %d", $node->nid);
$z = 0;