Open jnugent opened 2 years ago
I've done some more digging in this and I suspect the reason for this is that the QueryBuillder for authors selects *
here:
And joins on the publications table. Doesn't this potentially create two seq
columns in the result? I think it does, and the JSON is including the publication one, rather than the author one.
This query is also used when fetching authors for other purposes like when building the author string but the sort clause is table specific:
which is why sorting for authors is fine. It's just when you look at the JSON that there's a problem.
Describe the bug The returned JSON when fetching a publication with an API call of the type:
https://journal.org/index.php/path/api/v1/submissions/xxxxx/publications/xxxxx
Includes the wrong sequence for authors. It sets the seq attribute of all of the authors to the sequence the publication has in the issue. Here is a relevant database record showing the sequence of the publication:
And here is the JSON for some of the authors. The author sequence is circled:
I've dumped variables and it seems that this is set this way already, here:
https://github.com/pkp/pkp-lib/blob/3ffbbe19241323fd173cc1d38a847d02a7d91e97/classes/services/PKPPublicationService.inc.php#L171
Sequence is correctly set in the authors table for the record, and the author string is also correct.
Seen in 3.3.0.8