Bug 339344 - extra commas added in author field
Summary: extra commas added in author field
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: General (show other bugs)
Version: 0.5.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-24 01:02 UTC by manuel
Modified: 2016-02-16 08:38 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
erroneous bib file (4.37 KB, text/x-bibtex)
2014-09-24 23:22 UTC, manuel
Details
erroneous bib file - never saved (6.37 KB, text/x-bibtex)
2014-09-25 18:28 UTC, manuel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description manuel 2014-09-24 01:02:21 UTC
When saving a reference with only one entry in the author field (e.g. a corporate author like {Google}) KBibTeX adds a comma at the end of the field expecting a second name. 
This eventually leads to an error when building the bibliography. 
These commas seem to be added at every save and need to be removed automatically afterward. 

Reproducible: Always

Steps to Reproduce:
1. open *.bib file containing e.g.: 
@standard{IEC2005windTurbines,
	author = {IEC}}
2. save with KBibTex
3. the entry turned into: 
@standard{IEC2005windTurbines,
	author = {IEC,}}

N.B.: this is not obvious when just looking at the source code in KBibTex, but the comma can be seen when opening the bib file in a text editor. 

Actual Results:  
The entry is changed to: 
@standard{IEC2005windTurbines,
	author = {IEC,}}

Expected Results:  
The entry should be (without comma): 
@standard{IEC2005windTurbines,
	author = {IEC}}
Comment 1 Thomas Fischer 2014-09-24 20:36:15 UTC
I cannot reproduce this bug, so more information is required. To confirm how to reproduce it, your approach was as follows:
1. Start KBibTeX
2. Create a new, fresh file
3. Add a single entry as document above with an author field as its only content
4. Save as some .bib file

When saving a bib file for the first time or when calling Save As, there is a dialog where you can control certain settings (lower/upper case keywords, etc). Which settings did you use?
Can you reproduce your problem using the master version from Git? Can you reproduce your bug on another machine or with another or a fresh (temporary) user account?
Comment 2 manuel 2014-09-24 23:22:29 UTC
Created attachment 88831 [details]
erroneous bib file
Comment 3 manuel 2014-09-24 23:23:19 UTC
Thanks for the quick reply! 

I've played with it a bit more, and actually you are right: it's not so easy to reproduce. 
I had a bib file from JabRef, that i opened with KBibTex. That's where i got the problems. If i start a new file i do not reproduce the error, either. Not with a new entry, and not if i copy the erroneous ones into the new file. Strange.  
Attached i send you an excerpt of my file, which produced the error. The extra comma appears in the last entry, BladedTheory2012. 

Interestingly, if I copy all my library into a new file it's working. There must have been something wired with that old file? Are there some hidden saving settings? 

But never mind . It's working now. And sorry for the confusion.
Comment 4 Thomas Fischer 2014-09-25 17:18:05 UTC
> I've played with it a bit more, and actually you are right: it's not so easy
> to reproduce. 
> I had a bib file from JabRef, that i opened with KBibTex. That's where i got
> the problems. If i start a new file i do not reproduce the error, either.
> Not with a new entry, and not if i copy the erroneous ones into the new
> file. Strange.  
So, there is a problem with files coming from JabRef. Can you please attach a file from JabRef that does cause problems in KBibTeX, but that was never saved in KBibTeX?
Comment 5 manuel 2014-09-25 18:26:02 UTC
here you go. The comma will be added in the last entry (BladedTheory2012) once you save this in KBibTex.

N.B.: the problem appears only with this file. I can't reproduce it even when generating a new file in JabRef and opening that in KBibTex.
Comment 6 manuel 2014-09-25 18:28:22 UTC
Created attachment 88837 [details]
erroneous bib file - never saved
Comment 7 Christoph Feck 2014-10-25 14:55:03 UTC
Thomas, does comment #5, provide the requested information? Please change the bug status or add a comment.
Comment 8 Thomas Fischer 2014-11-01 18:20:17 UTC
(In reply to manuel from comment #5)
> here you go. The comma will be added in the last entry (BladedTheory2012)
> once you save this in KBibTex.
> 
> N.B.: the problem appears only with this file. I can't reproduce it even
> when generating a new file in JabRef and opening that in KBibTex.

(In reply to Christoph Feck from comment #7)
> Thomas, does comment #5, provide the requested information? Please change
> the bug status or add a comment.

Ok, I tried the attached .bib file. Before saving, the last entry looks like this:

@Manual{BladedTheory2012,
  Title                    = {Bladed Theory Manual, Version 4.3},
  Author                   = {Bladed},
  Organization             = {Garrad Hassan \& Partners Ltd.},
  Year                     = {2012},

  Institution              = {Garrad Hassan \& Partners Ltd},
  Owner                    = {mfluck},
  Timestamp                = {2013.10.08}
}

After saving:

@manual{BladedTheory2012,
        author = {Bladed},
        institution = {Garrad Hassan \& Partners Ltd},
        organization = {Garrad Hassan \& Partners Ltd.},
        owner = {mfluck},
        timestamp = {2013.10.08},
        title = {Bladed Theory Manual, Version 4.3},
        year = {2012}
}

So, no problem here.

The next possible reason I can see is a corrupted KBibTeX configuration file. manuel, you can test a few things:
(a) Create a new account on your system, without any configuration files. Open and save the file to see if the problem can be still reproduced.
(b) Move ~/.kde4/share/config/kbibtexrc to a safe location, open and save the file.
(c) Show the output of    grep personNameFormatting ~/.kde4/share/config/kbibtexrc
Comment 9 manuel 2014-11-01 19:10:54 UTC
ok i have 
a) moved to a new account; problem still the same. 
b) Move ~/.kde4/share/config/kbibtexrc to a backup folder, opened and saved it. 
-> now ~/.kde4/share/config/kbibtexrc does not exist anymore; can't grep anything in it. 
c1) opened KBibTeX -> new ~/.kde4/share/config/kbibtexrc created. 
c2) grep personNameFormatting ~/.kde4/share/config/kbibtexrc finds no matches. 
(also no matches in the old file)
Comment 10 manuel 2014-11-01 19:12:40 UTC
but don't worry too much. If it's only me having this problem i can also use JabRef, which is working just fine.
Comment 11 Thomas Fischer 2014-11-01 21:03:09 UTC
(In reply to manuel from comment #9)
> ok i have 
> a) moved to a new account; problem still the same. 
> b) Move ~/.kde4/share/config/kbibtexrc to a backup folder, opened and saved
> it. 
> -> now ~/.kde4/share/config/kbibtexrc does not exist anymore; can't grep
> anything in it. 
> c1) opened KBibTeX -> new ~/.kde4/share/config/kbibtexrc created. 
> c2) grep personNameFormatting ~/.kde4/share/config/kbibtexrc finds no
> matches. 
> (also no matches in the old file)
Sorry, my instructions were a little bit confusing. I did not mean it as a sequence (a to c), but as a list of alternatives to try out, reverting to the original state (e.g. restoring kbibtexrc as it was) after each test.
So, for the grep command, did your original kbibtex contain a line containing personNameFormatting?

However, as you said that the same problem exist for you on a fresh account without any existing configuration, the bug may not be related to configuration issues ...
Can you please test the most recent master version from git?
Comment 12 Thomas Fischer 2014-11-01 21:04:19 UTC
(In reply to manuel from comment #10)
> but don't worry too much. If it's only me having this problem i can also use
> JabRef, which is working just fine.
(1) we don't know if you are the only one, you are only the first to report the problem, and (2) having you using JabRef is not acceptable for me ;-)
Comment 13 Thomas Fischer 2016-02-15 19:23:43 UTC
(In reply to manuel from comment #10)
> but don't worry too much. If it's only me having this problem i can also use
> JabRef, which is working just fine.
Does the problem in KBibTeX still exist for you?
Comment 14 manuel 2016-02-16 08:19:31 UTC
Thanks for checking back, Thomas. 
The problem actually does not exist anymore! 
Seems like I can switch over to KBibTeX now. 
Thanks again!