[imp] expanding names doesn't work for me....

nlin@newton.berkeley.edu nlin@newton.berkeley.edu
Wed, 31 Oct 2001 10:13:09 -0800


Okay, I just dug through the code and I think I've figured out why the 
"Search fields" panel in Options->Addressbook was confusing me.

In my turba/config/sources.php file, I have:

    'search' => array(
        'name',
        'email',
        'workPhone', 
    ),

where workPhone is something I added to turba/config/attributes.php.
But in Options->Addressbook, it was only displaying "Name" & "Email".  It 
never displayed "workPhone" so I didn't know where things were coming from.

Anyways, I think this is a bug in the code, and here's the diff.  It's just 
moving the $field_count++ into the if statement.  Sorry if my diff is in the 
wrong format.


nancy

-------------
*** sourceselect.inc    Wed Oct 31 10:11:36 2001
--- sourceselect.inc.orig       Wed Oct 31 10:04:40 2001
***************
*** 59,66 ****
              if ($field['search']) {
                  $marked = isset($selected_fields[$source]) && 
in_array($field['name'], $selected_fields[$source]) ? 'true' : 'false';
                  $js .= "searchFields[$source_count][$field_count] = new 
Array('" . $field['name'] . "', '" . $field['desc'] . "', $marked);\n";
-                 $field_count++;
              }
          }
          
          $source_count++;
--- 59,66 ----
              if ($field['search']) {
                  $marked = isset($selected_fields[$source]) && 
in_array($field['name'], $selected_fields[$source]) ? 'true' : 'false';
                  $js .= "searchFields[$source_count][$field_count] = new 
Array('" . $field['name'] . "', '" . $field['desc'] . "', $marked);\n";
              }
+             $field_count++;
          }
          
          $source_count++;