in2code-de / publications

Follower of EXT:bib to show publications in TYPO3. Im- and export of bibtext and xml files.

Home Page:https://www.in2code.de/agentur/typo3-extensions/publications/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InitialsViewhelper trims too many names

karliwalti opened this issue · comments

Issue:

names with 2 or more middle names, which are not fully stored in database, are trimmed to only 2 initials

Desired output:

InitialsViewHelper combines all available initials as configured

detailed description

InitialsViewHelper.php
https://github.com/in2code-de/publications/blob/develop/Classes/ViewHelpers/Format/InitialsViewHelper.php
is used to format names in citestyles. Often, longer names (more than 1 middle name) are already compressed in the database like : "Rambo, John J.P."
Another example is given in the uploaded test bib collection
https://github.com/in2code-de/publications/files/9869881/TestLibraryPublications.txt

the viewhelper does not recognize that the middle names are multiple, as they are separated by a '.'

suggested solution

explode name for ' ' and '.' in viewhelper

$names = GeneralUtility::trimExplode(' ', $this->renderChildren(), true);

commented

solved with #65