"Roland Winkler" <wink...@gnu.org> writes:

Hi Roland,

Here's my steps to produce the problem. Starting from *BBDB* buffer, I
hit 'c' to create an entry. Prompted for "Name" I enter "Fake Entry" and
his RET. Prompted for "Organizations" I enter nothing, just hit
RET. Prompted for "email" I enter "f...@entry.org" and hit RET. I RET
through the remainder of the preset fields, to conclude entering the
data.

Then I put point on the entry (anywhere) and enter 'i' to add a
field. Prompted, I type "organization" and get the result of "field
"organization" already exists."

However I note that if instead of "organization" I type "organizations"
(plural--which is the actual name of the field I think) I'm told
"'organizations' is an unknown field name. Define it?" Not sure if that's 
important or not, and sorry that this "bug report" is
probably not written anything like an actual bug report!

Also, when I hit 'i' in this example and type 'phone,' it proceeds
perfectly normally to add the field. So I think the issue is only with
the organization(s) field.

I will try the solution you posted later today or tomorrow.

Thank you!
Steven Arntson

 > On Fri Mar 28 2014 Steven Arntson wrote:
>> I think I've got an invisible organization field, somehow.  
>
> I'd be curious to know how you succeeded to create an organization
> field which appears to consist of an empty string.  This should not
> happen and there seems to be a bug *somewhere*.  If you can come up
> with a recipe to reproduce this, please post it here.
>
>> I have, for instance, an short entry like:
>> 
>> Friendly Acquaintence - 
>>          mail: frien...@provider.com
>
> Put point somewhere in this record and run the command attached
> below, which should solve your problem.  I am thinking about putting
> a slightly different solution into the BBDB repository.  Yet in the
> meanwhile this should work for you.
>
> (defun bbdb-fix-records (records)
>   "Fix broken RECORDS.
> Interactively, use BBDB prefix \
> \\<bbdb-mode-map>\\[bbdb-do-all-records], see `bbdb-do-all-records',"
>   (interactive (list (bbdb-do-records)))
>   (bbdb-editable)
>   (dolist (record (bbdb-record-list records))
>     (let (organizations)
>       (dolist (organization (bbdb-record-organization record))
>         (if (and organization (not (string= "" organization)))
>             (push organization organizations)))
>       (bbdb-record-set-field record 'organization (nreverse organizations)))
>     (bbdb-change-record record)))
>
> ------------------------------------------------------------------------------
> _______________________________________________
> bbdb-info@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bbdb-info
> BBDB Home Page: http://bbdb.sourceforge.net/


------------------------------------------------------------------------------
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to