Closed felixhelix closed 1 year ago
@seboettg Can you have a look at this? Thanks, Felix
@seboettg I digged into this and I think the problem is with the boolval() function in InheritableNameAttributesTrait,php:
$this->initialize = boolval((string) $attribute);
boolval returns "true" for any string but an empty one. So even if the attribute value is "false", it returns true. Accordingly, the name gets abbrevitated if initializeWith is not empty:
$useInitials = $this->initialize && !is_null($this->initializeWith) && $this->initializeWith !== false;
(Name.php)
A solution could be to assign the value as this:
$this->initialize = ((string) $attribute) == 'true' ? true : false;
This should then be applied to 'et-al-use-last' as well, as here also boolval() is used.
What do you think?
Your's
Felix
Hey @felixhelix! Thank you for debugging this issue. I'm gonna build a fix soon.
@felixhelix Can you confirm that the issue is fixed by closing this ticket?
@seboettg
I cloned the updated repo to test it in my local OJS installation. I also needed to update the Collection repo because I got the error "undefined method Seboettg\Collection\ArrayList::collectToString()".
Now I get the error
[::1]:64910 [500]: GET /index.php/ojstest/article/view/7 - Uncaught Error: Call to undefined method Seboettg\Collection\ArrayList::hasKey() in C:\Users\steph\Documents\UB\development\ojs-3.3.0-8\plugins\generic\citationStyleLanguage\lib\vendor\seboettg\citeproc-php\src\Locale\LocaleXmlParserTrait.php:132
can you help me with that?
Yours,
Felix
Hi @felixhelix I assume citeproc try to use a wrong version of seboettg/collection. Please run the following command in the project root directory where citeproc-php is used:
composer show seboettg/collection
You should find a version hint that look like that:
versions : * v3.1.0
Please follow the general troubleshooting steps first:
Bug reports:
If initialize="false" and initialize-with=". " is given, the latter is only applied if Initials are already given:
From the specs:
Unfortunately citeproc-php seems to initialize a name even if initialize="false" but initialize-with=". " is given.
Used CSL stylesheet:
modern-language-association.csl
The respective section is:
Used CSL metadata
Please replace these lines with your used metadata, for instance:
Yours Felix