Index: 0.3-modules/situacion_actual_preliminar/situacion_actual_preliminar.module
===================================================================
--- 0.3-modules/situacion_actual_preliminar/situacion_actual_preliminar.module	(revision 2bc6c7ee02d0c8ab1f09bf386bdcc082f4215810)
+++ 0.3-modules/situacion_actual_preliminar/situacion_actual_preliminar.module	(revision 82c7176a0a17dcf23628d456dce5ea66e56cf5c8)
@@ -816,5 +816,5 @@
   $causas_input = array();
   $acceso = _get_situacion_explicacion_acceso($ente_planificador, $tipo_plan, $descriptor);
-  $sql = "SELECT c.nid, n.title, nr.body, c.field_tipo_causa_value, c.field_causa_control_value FROM {content_type_causas} AS c INNER JOIN {node} AS n ON c.nid = n.nid AND c.vid = n.vid INNER JOIN {node_revisions} AS nr ON c.nid = nr.nid AND c.vid = nr.vid WHERE c.field_ente_planifiador_nid = %d AND c.field_causas_year_value = %d";
+  $sql = "SELECT c.nid, n.title, nr.body, c.field_tipo_causa_value, c.field_causa_control_value FROM {content_type_causas} AS c INNER JOIN {node} AS n ON c.nid = n.nid AND c.vid = n.vid AND n.type = 'causas'  INNER JOIN {node_revisions} AS nr ON c.nid = nr.nid AND c.vid = nr.vid WHERE c.field_ente_planifiador_nid = %d AND c.field_causas_year_value = %d";
   $sql .= ' AND c.field_causas_' . $tipo_plan['short'] . '_value = %d';
   $inputs = array();
@@ -915,5 +915,5 @@
     }
   }
-  $sql = "SELECT c.nid, n.title, nr.body, c.field_tipo_causa_value, c.field_causa_control_value FROM {content_type_causas} AS c INNER JOIN {node} AS n ON c.nid = n.nid AND c.vid = n.vid INNER JOIN {node_revisions} AS nr  ON c.nid = nr.nid AND c.vid = nr.vid WHERE c.field_ente_planifiador_nid = %d AND c.field_causas_year_value = %d";
+  $sql = "SELECT c.nid, n.title, nr.body, c.field_tipo_causa_value, c.field_causa_control_value FROM {content_type_causas} AS c INNER JOIN {node} AS n ON c.nid = n.nid AND c.vid = n.vid AND n.type = 'causas' INNER JOIN {node_revisions} AS nr  ON c.nid = nr.nid AND c.vid = nr.vid WHERE c.field_ente_planifiador_nid = %d AND c.field_causas_year_value = %d";
   $sql .= ' AND c.field_causas_' . $tipo_plan['short'] . '_value = %d ORDER BY c.nid';
   $inputs = array();
@@ -2170,5 +2170,5 @@
   //se obtienen los descriptores
   $descriptores = array();
-  $sql = "SELECT c.nid, n.title, nr.body FROM {content_type_descriptores} AS c INNER JOIN {node} AS n ON c.nid = n.nid AND c.vid = n.vid INNER JOIN {node_revisions} AS nr  ON c.nid = nr.nid AND c.vid = nr.vid WHERE c.field_descriptores_planificador_nid = %d AND c.field_descriptores_year_value = %d";
+  $sql = "SELECT c.nid, n.title, nr.body FROM {content_type_descriptores} AS c INNER JOIN {node} AS n ON c.nid = n.nid AND c.vid = n.vid AND n.type = 'descriptores' INNER JOIN {node_revisions} AS nr  ON c.nid = nr.nid AND c.vid = nr.vid WHERE c.field_descriptores_planificador_nid = %d AND c.field_descriptores_year_value = %d";
   $inputs = array();
   $inputs[] = $ente_planificador;
@@ -2207,5 +2207,5 @@
     //se obtienen las causas
     //field_descriptores_causa
-    $sql = "SELECT c.field_descriptores_causa_nid as nid, c.nid as descriptor, n.title, nr.body FROM {content_field_descriptores_causa} AS c INNER JOIN {node} AS n ON c.field_descriptores_causa_nid = n.nid INNER JOIN {node} AS n1 ON c.nid = n1.nid AND c.vid = n1.vid INNER JOIN {node_revisions} AS nr ON n.nid = nr.nid AND n.vid = nr.vid WHERE c.nid IN (" . $implode . ") ORDER BY c.field_descriptores_causa_nid";
+    $sql = "SELECT c.field_descriptores_causa_nid as nid, c.nid as descriptor, n.title, nr.body FROM {content_field_descriptores_causa} AS c INNER JOIN {node} AS n ON c.field_descriptores_causa_nid = n.nid AND n.type = 'causas' INNER JOIN {node} AS n1 ON c.nid = n1.nid AND c.vid = n1.vid INNER JOIN {node_revisions} AS nr ON n.nid = nr.nid AND n.vid = nr.vid WHERE c.nid IN (" . $implode . ") ORDER BY c.field_descriptores_causa_nid";
     $result = db_query($sql, $inpunts_values);
     while($causa = db_fetch_object($result)) {
@@ -2219,5 +2219,5 @@
     //se obtienen los cambios
     //field_descriptor_cambio_nid 
-    $sql = "SELECT c.field_descriptor_cambio_nid as nid, c.nid as descriptor, n.title, nr.body FROM {content_field_descriptor_cambio} AS c INNER JOIN {node} AS n ON c.field_descriptor_cambio_nid = n.nid INNER JOIN {node} AS n1 ON c.nid = n1.nid AND c.vid = n1.vid INNER JOIN {node_revisions} AS nr ON n.nid = nr.nid AND n.vid = nr.vid WHERE c.nid IN (" . $implode . ") ORDER BY c.field_descriptor_cambio_nid";
+    $sql = "SELECT c.field_descriptor_cambio_nid as nid, c.nid as descriptor, n.title, nr.body FROM {content_field_descriptor_cambio} AS c INNER JOIN {node} AS n ON c.field_descriptor_cambio_nid = n.nid AND n.type = 'cambios' INNER JOIN {node} AS n1 ON c.nid = n1.nid AND c.vid = n1.vid INNER JOIN {node_revisions} AS nr ON n.nid = nr.nid AND n.vid = nr.vid WHERE c.nid IN (" . $implode . ") ORDER BY c.field_descriptor_cambio_nid";
     $result = db_query($sql, $inpunts_values);
     while($meta = db_fetch_object($result)) {
