Add Contact Problem

adam@morrison-ind.com adam@morrison-ind.com
Fri, 17 Aug 2001 11:16:06 -0400


I have PHP 4.0.6 with PEAR (/usr/local/lib/php) from CVS as of yesterday
(16Aug2001) and Horde, IMP and Turba from CVS as of this morning (17Aug2001).  I
have IMP working more or less flawlessly, and Turba is working to search our
local LDAP directory.  But adding contacts to my personal address book results
in errors.

>From /var/www/html/horde/turba/config/sources.php - 
$cfgSources['localsql'] = array(

    'title' => 'Personal Address Book',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'pgsql',
        'hostspec' => 'kohocton',
        'username' => 'nobody',
        'password' => '',
        'database' => 'turba',
        'options' => '',
        'tty' => '',
        'port' => '5432',
        'protocol' => 'unix',
        'table' => 'Turba_Objects'
    ),
    'map' => array(
        '__key' => 'object_ID',
        '__owner' => 'owner_ID',
        'name' => 'name',
        'email' => 'email',
        'homeAddress' => 'homeAddress',
        'workAddress' => 'workAddress',
        'homePhone' => 'homePhone',
        'workPhone' => 'workPhone',
        'cellPhone' => 'cellPhone',
        'fax' => 'fax',
        'title' => 'title',
        'company' => 'company',
        'notes' => 'notes'
    ),
    'public' => false,
    'readonly' => false
);

I see that connections have been made to postgresql - 
$ps ax | grep post
 1780 ?        S      0:02 /usr/bin/postmaster -i  
20664 ?        S      0:00 /usr/bin/postgres localhost nobody turba idle
21073 ?        S      0:00 /usr/bin/postgres localhost nobody turba idle
21074 ?        S      0:00 /usr/bin/postgres localhost nobody turba idle
21095 ?        S      0:00 /usr/bin/postgres localhost nobody turba idle
....

Searching returns nothing as one would expect as the table is empty,  but no
errors (at least as far as I can see).

In "psql turba" -
turba=# \d turba_objects
         Table "turba_objects"
  Attribute  |     Type     | Modifier 
-------------+--------------+----------
 object_id   | varchar(32)  | not null
 owner_id    | varchar(32)  | not null
 name        | varchar(255) | 
 alias       | varchar(32)  | 
 email       | varchar(255) | 
 homeaddress | varchar(255) | 
 workaddress | varchar(255) | 
 homephone   | varchar(25)  | 
 workphone   | varchar(25)  | 
 cellphone   | varchar(25)  | 
 fax         | varchar(25)  | 
 title       | varchar(32)  | 
 company     | varchar(32)  | 
 notes       | text         | 
Index: turba_objects_pkey

which is the table the script made.

The error I get upon adding contact is -
<br>
<b>Warning</b>:  Undefined index:   in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>23</b><br>
<br>
<b>Warning</b>:  Undefined index:   in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>24</b><br>
<br>
<b>Warning</b>:  Undefined index:   in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>25</b><br>
<br>
<b>Warning</b>:  Undefined index:   in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>26</b><br>
<br>
<b>Warning</b>:  Undefined index:   in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>27</b><br>
<br>
<b>Warning</b>:  Undefined index:   in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>28</b><br>
<br>
<b>Warning</b>:  Undefined index:  object in
<b>/var/www/html/horde/turba/addobjectaction.php</b> on line <b>30</b><br>
<br>
<b>Fatal error</b>:  Call to a member function on a non-object in
<b>/var/www/html/horde/turba/lib/Source.php</b> on line <b>261</b><br>

Any suggestions?