Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OJS 3.0.2] Can't switch to APA or CBE Citation Formats #2288

Closed
Ph-We opened this issue Feb 14, 2017 · 10 comments
Closed

[OJS 3.0.2] Can't switch to APA or CBE Citation Formats #2288

Ph-We opened this issue Feb 14, 2017 · 10 comments
Milestone

Comments

@Ph-We
Copy link

Ph-We commented Feb 14, 2017

If we try to switch to either APA or CBE the displayed format stays the same.
http://forum.pkp.sfu.ca/t/problem-with-first-name-displaying-in-citation/28641

@Ph-We Ph-We changed the title Can't switch to APA and CBE Citation Formats [OJS 3] Can't switch to APA and CBE Citation Formats Feb 14, 2017
@Ph-We Ph-We changed the title [OJS 3] Can't switch to APA and CBE Citation Formats [OJS 3.0.2] Can't switch to APA and CBE Citation Formats Feb 14, 2017
@Ph-We Ph-We changed the title [OJS 3.0.2] Can't switch to APA and CBE Citation Formats [OJS 3.0.2] Can't switch to APA or CBE Citation Formats Feb 14, 2017
@asmecher
Copy link
Member

@Ph-We, I'm afraid I can't replicate this behavior -- both citation formats appear to work OK for me. Can you investigate further?

@Ph-We
Copy link
Author

Ph-We commented Feb 22, 2017

@asmecher, Yes, after some further investigation I've found that the issue is stably replicated only with Cyrillic entries. This might probably be something akin to that one:
http://forum.pkp.sfu.ca/t/problem-with-first-name-displaying-in-citation/28641/7

Here is an example
https://cmd-journal.hse.ru/article/view/2900
(switch to Русский)

@asmecher
Copy link
Member

@Ph-We, can you check your browser's console for a Javascript error?

@asmecher
Copy link
Member

Using Firebug, I see that the response is blank; did anything show up in the PHP error log?

@Ph-We
Copy link
Author

Ph-We commented May 19, 2017

Hi @asmecher, I've traced the issue might be related to this error in PHP log:
[19-May-2017 13:09:03 Europe/Berlin] Malformed UTF-8 characters, possibly incorrectly encoded

@asmecher
Copy link
Member

@Ph-We, I think this means that a call to PHP's json_encode encountered invalid character encodings. Is it possible that there is non-UTF8 data in your database, or that your database connection parameters in config.inc.php aren't appropriate for UTF8?

@Ph-We
Copy link
Author

Ph-We commented May 25, 2017

@asmecher, I could reproduce this with three different installations: productive, test, localhost. On the latter there was only one article with most simple words in its title. And I did not touch config.inc.php. So I doubt there could be any non-UTF8 or malformed UTF8 data.

@asmecher
Copy link
Member

@Ph-We, I suspect the message is coming from JSONMessage.inc.php. In order to confirm that this is the case, and check what content is causing trouble, can you modify the file and change...

error_log(json_last_error_msg());

...to...

error_log(json_last_error_msg());
error_log("Subject: " . print_r($jsonObject, true));

@Ph-We
Copy link
Author

Ph-We commented May 26, 2017

@asmecher, thanks, now I've got something more informative:

[26-May-2017 10:50:04 Europe/Berlin] Malformed UTF-8 characters, possibly incorrectly encoded

[26-May-2017 10:50:04 Europe/Berlin] Subject: Array
(
    [status] => 1
    [content] => 	

		Р�ванов, Р., & 		РЎРёРґРѕСЂРѕРІ, Р.
(2017).
 Статья о главном.
<em>Журнал о жизни, 1</em>(1), 1-33.
doi:10.1234/.v1i1.3
    [elementId] => 0
)

So it seems to count any Cyrillic characters as malformed UTF8, since they really get malformed at some stage.

@asmecher
Copy link
Member

Ah, @Ph-We, I found it. The Smarty truncate modifier was being used to get the author's first initial for both of those formats, and it's not UTF-8 aware. Try the patch attached to this issue.

@asmecher asmecher added this to the OJS 3.1 milestone May 26, 2017
asmecher added a commit to asmecher/ojs that referenced this issue May 26, 2017
asmecher added a commit to asmecher/ojs that referenced this issue May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants