winkm89 / teachPress

Official repository of teachPress (publication management plugin for WordPress)
GNU General Public License v2.0
56 stars 43 forks source link

Bibtex author names not parsed correctly #225

Closed RaulMurillo closed 1 year ago

RaulMurillo commented 1 year ago

It seems this automatic detection is not working on the current version (9.0.0).

Here is an example bibtex:

@book{testBook,
title = {Sample Book},
author = {Murillo, Raul and Botella, Guillermo},
year  = {2024},
date = {2024-06-04},
keywords = {},
pubstate = {published},
tppubtype = {book}
}

And the output in my Wordpress is the following:

Murillo, Raul; Botella, Guillermo

Sample Book Book

2024.

However, the proper author names should be Raul Murillo; Guillermo Botella. I am using the following options to display the publication:

[tplist show_tags_as="none" author_name="simple" editor_name="simple" author_separator=";" editor_separator=","]

Any ideas about what is happening?

Originally posted by @RaulMurillo in https://github.com/winkm89/teachPress/issues/15#issuecomment-1573775013

winkm89 commented 1 year ago

Hi Raul, I've tested the example several times, an it works as expected (for example the first author is imported correctly as Raul Murillo). So it seems that this is not a general bug.

Which PHP version you are using?

RaulMurillo commented 1 year ago

Current;y we are using PHP 7.4.33 Is it possible that this old version is causing the issue?

RaulMurillo commented 1 year ago

In fact, I updated PHP to the latest 8.2 version, but the display of authors is still in the <last name>, <name> form.

winkm89 commented 1 year ago

Ok, that excludes PHP as a source of this error. It's really strange.

Do you import the bibtex entry as a file or as a input into the textfield? If it's a file, could you upload a sample file?

RaulMurillo commented 1 year ago

Ok, maybe that is the key to this topic. I am importing the bibtex entries with the Auto-publish utility of the plugin. More specifically, I am using the following URL, which displays bibtex from Google scholar in the above format: https://scholar.googleusercontent.com/citations?view_op=export_citations&user=QzdxUe8AAAAJ&citsig=ACseELIAAAAAZIg7S31BrlDsNgjlutO25e2uokM&hl=es

I realized that if I import the same bibtex entries manually, the error disappears. But with Auto-publish, the names and last names are flipped.

fabricebg commented 1 year ago

I can confirm that the code for the Auto-publish feature uses a default parsing policy for authors that creates this problem. A way to specify the kind of author parsing for a given source (or, more simply, for all sources) should be added to the current code to fix this.

RaulMurillo commented 1 year ago

Thanks! That last commit solved it, and updating to the latest version (9.0.2) was enough.