File revisions are shown in the wrong review round after upgrade from OJS 2.4.8 to OJS 3.1.2

Application Version: OJS 2.4.8 Upgarde to OJS 3.1.2

This is a follow-up of the post: Review file not correct after Upgrade from OJS 2.4.8 to OJS 3.1.2

Description of issue
After upgrading OJS 2.4.8 to OJS 3.1.2 always the latest revision of a file is shown for all review rounds irrespective of the actual review round the revision was originally submitted to.

Example: There exist three revisions of a submission file. The first two have been submitted with review round 1 in OJS 2.4.8 and the third one with review round 2 in OJS 2.4.8.
After the upgrade to OJS 3.1.2 revision 3 is shown in all review rounds.
See screenshots in: Review file not correct after Upgrade from OJS 2.4.8 to OJS 3.1.2

What we tried to resolve the issue
The issue can be resolved by changing


in the file /lib/pkp/controllers/grid/files/review/ to


However, looking at the function names this doesn’t seem to be the proper fix since getLatestRevisionsByReviewRound(…) suggest to yield the latest revision of the corresponding review round as intended, i.e. in our example revision 2 for review round 1 and revision 3 for review round 2. It does, however, always return revision 3.

This would suggest that the issue is related to the SQL queries located in _getInternally() in classes/submission/ not considering the review round when $latestOnly is true.

Since we don’t want to apply a local patch but rather submit a general fix any advise is welcome on how these functions are supposed to work or where/how to best apply the fix.

Best wishes,

E-Publishing Group, Center for Digital Systems, Free University Berlin