Composer.json file is pointing to 1.x which doesn't contain the code changes in the vendor/academicpuma/citeproc-php/src/Name.php file for refactor and change to switch case (to if -else).
switch ($this->{'name-as-sort-order'}) {
case 'first' && $rank == 0:
case 'all':
$text = $ndp . $name->family . $this->sort_separator . $given;
break;
default:
$text = $given . ' ' . $ndp . $name->family . $suffix;
}
Should show
if ($this->{'name-as-sort-order'} === 'all'
|| ($this->{'name-as-sort-order'} === 'first' && $rank == 0)) {
$text = $ndp . $name->family . $this->sort_separator . $given;
} else {
$text = $given . ' ' . $ndp . $name->family . $suffix;
}
}
WHY?
- This switch case's logic is broken and will always do the opposite of what is set for the first author/contributor. By using an if/else statement instead, the logic works as expected and will use the name-as-sort-order value and produce the expected results.
Suggested fix:
-> Change academicpuma/citeproc-php: "1.x" to "dev-master" -- I know this package is abandoned and we should be using the new citeproc-php package but our site still uses this old package and we don't have the bandwidth to migrate at this time so we must maintain the old version.
-> While we're at it, I propose changing the text case on this package "technosophos/libris" to all lowercase.
Comments
Comment #2
antongp commentedHi.
We prefer not touching version constraint for this library in the module's composer.json file at the moment, so it'll stay
~1.0.I would suggest to explicitly install this library of needed version using your root composer.json file. The following trick should do the job:
composer require academicpuma/citeproc-php:"dev-master as 1.0.0"But we're not responsible for any possible issues caused by using of latest dev of this library. You'll also need to manually remove it once the module switched to another library.
Yes, we're aware of this warning and will change the package name within some other changes in the module's composer.json file.
Thank you.