[imp] add_source preference value

Ronan SALMON rsalmon at mbpgroup.com
Thu Jul 28 14:19:22 UTC 2011


Quoting Vilius Šumskas <vilius at lnk.lt>:

>> Vilius Šumskas <vilius at lnk.lt> a écrit :
>>
>> >> Zitat von Vilius ?umskas <vilius at lnk.lt>:
>> >>
>> >> > Hello,
>> >> >
>> >> > add_source preference description reads:
>> >> >
>> >> > // Address book to use for adding addresses.
>> >> > // Put $cfgSources array element name in the value field.
>> >> > // Setting value to localsql would allow you to add contacts to
>> >> > MySQL database
>> >> > // See turba/config/sources.php for more info
>> >> >
>> >> > However with H4 this doesn't work anymore. I get "Unknown address
>> >> > book 'localsql'." every time I send an email. Also, when I re-save
>> >> > preferences trough GUI and look at MySQL database I see that the new
>> >> > add_source preference value goes like "NAkkIDxJBD9OMCV5CTiyKsA".
>> >> > What is the correct corresponding value for this preference under H4
>> >> > so I can put it to prefs.local.php for all new users?
>> >>
>> >> See the example hook.
>> >
>> > OK. I have enabled prefs_init hook in imp/config/hooks.php
>> >
>> > I have created imp/config/prefs.local.php with a content:
>> >
>> > $_prefs['add_source'] = array(
>> >     'value' => '',
>> >     'type' => 'enum',
>> >     'enum' => array(),
>> >     'hook' => true,
>> >     'desc' => _("Choose the address book to use when adding addresses.")
>> > );
>> >
>> > I still get the same message about unknown address book 'localsql'
>> > when sending email. Seems like
>> > $GLOBALS['registry']->call('contacts/getDefaultShare'); returns
>> > 'localsql' instead of share id.
>>
>>
>> try this :
>> prefs.local.php :
>> $_prefs['search_sources']['value'] = '';
>> $_prefs['search_sources']['locked'] = true;
>> $_prefs['search_sources']['hook'] = true;
>> $_prefs['search_fields']['value'] = '';
>> $_prefs['search_fields']['locked'] = true;
>> $_prefs['search_fields']['hook'] = true;
>> $_prefs['add_source']['value'] = '';
>> $_prefs['add_source']['locked'] = true;
>> $_prefs['add_source']['hook'] = true;
>>
>>
>> enable hooks using the provided examples for those 3 prefs and remove
>> the actual values in your prefs backend.
>
> Still doesn't work. I have verified that 'localsql' value really  
> comes from $GLOBALS['registry']->call('contacts/getDefaultShare');  
> in a hook by adding "test" string in front of the call and get  
> 'testlocalsql'. So the hook is working but doesn't return correct  
> value of the share id.
>

Actually, I though this was working here, but I doesn't :-(

I don't get the localsql error when I send a message, but the email  
address is not automatically added to my personal address book.

Ronan



More information about the imp mailing list