--- custom_breadcrumbs.module.D5	2007-08-17 15:09:00.000000000 -0300
+++ custom_breadcrumbs.module	2007-08-17 14:45:39.000000000 -0300
@@ -21,8 +21,7 @@ function custom_breadcrumbs_menu($may_ca
       'path' => 'admin/build/custom_breadcrumbs/add',
       'title' => t('Add custom breadcrumb'),
       'type' => MENU_CALLBACK,
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('custom_breadcrumbs_form'),
+      'callback' => 'custom_breadcrumbs_form',
       'access' => $access
     );
 
@@ -30,8 +29,7 @@ function custom_breadcrumbs_menu($may_ca
       'path' => 'admin/build/custom_breadcrumbs/edit',
       'title' => t('Edit custom breadcrumb'),
       'type' => MENU_CALLBACK,
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('custom_breadcrumbs_form'),
+      'callback' => 'custom_breadcrumbs_form',
       'access' => $access
     );
   }
@@ -49,8 +47,8 @@ function custom_breadcrumbs_nodeapi($nod
       $titles = explode("\n", $breadcrumb->titles);
       $paths = explode("\n", $breadcrumb->paths);
 
-      $titles = module_exists('token') ? token_replace($titles, 'node', $node) : $titles;
-      $paths = module_exists('token') ? token_replace($paths, 'node', $node) : $paths;
+      $titles = module_exist('token') ? token_replace($titles, 'node', $node) : $titles;
+      $paths = module_exist('token') ? token_replace($paths, 'node', $node) : $paths;
 
       $trail = array(l(t('Home'), ''));
       for ($i = 0; $i < count($titles); $i++) {
@@ -59,6 +57,7 @@ function custom_breadcrumbs_nodeapi($nod
           $trail[] = l($title, trim($paths[$i]));
         }
       }
+      $trail[] = $node->title;
       drupal_set_breadcrumb($trail);
     }
   }
@@ -101,7 +100,7 @@ function custom_breadcrumbs_form() {
   }
 
   $options = array();
-  foreach (node_get_types('names') as $type => $name) {
+  foreach (node_get_types() as $type => $name) {
     $options[$type] = $name;
   }
 
@@ -138,7 +137,7 @@ function custom_breadcrumbs_form() {
     '#description' => t("The following placeholder tokens can be used in both paths and titles. When used in a path or title, they will be replaced with the appropriate values."),
   );
 
-  if (module_exists('token')) {
+  if (module_exist('token')) {
     $form['help']['tokens'] = array(
       '#value' => theme('token_help', 'node'),
     );
@@ -160,14 +159,16 @@ function custom_breadcrumbs_form() {
     );
   }
 
-  return $form;
+  return drupal_get_form('custom_breadcrumbs_form', $form);
 }
 
-function custom_breadcrumbs_form_validate($form_id, $form_values) {
-  $path_count = count(explode("\n", $form_values['paths']));
-  $title_count = count(explode("\n", $form_values['titles']));
-  if ($title_count != $path_count) {
-    form_set_error(t('Every link path must have a matching title. There are !paths paths, and !titles titles.', array('!paths' => $path_count, '!titles' => $title_count)));
+function custom_breadcrumbs_form_validate($form_id, $form) {
+  $path_count = count(explode("\n", $form['paths']));
+  $title_count = count(explode("\n", $form['titles']));
+  if ($title_count != $path_count) {    
+    form_set_error($form_id, t('Every link path must have a matching title. There are !paths paths, and !titles titles.', array('!paths' => $path_count, '!titles' => $title_count)));
+    form_set_error('titles',' '); //setting an empty error makes no message, but higtlighs form-element
+    form_set_error('paths',' ');
   }
 }
 
@@ -229,4 +230,4 @@ function _custom_breadcrumbs_save_breadc
 function _custom_breadcrumbs_delete_breadcrumb($bid) {
   $sql = 'DELETE FROM {custom_breadcrumb} WHERE bid = %d';
   db_query($sql, $bid);
-}
+}
\ No hay ningún carácter de nueva línea al final del fichero
