1. QI-install a populated board. You get some number of topics per forum which are all unread.
2. Go into the forum and create another page (25+) worth of topics. These are read since you created them.
3. Go to the forum (topic listing).
With the patch applied, "mark topics read" is gone. However there are unread topics on page 2.
It may be the case that "mark topics read" is not quite relevant. It is more accurately "mark forum read". If this change is made, then hiding this link should only be done when all topics in the forum are read, and normal viewforum code in my estimation never fetches all topics for display purposes due to pagination/other constraints, therefore either you need to find a query that does pull something out of the entire set of topics in the forum and piggy-back onto it, or a patch would need to add a query to determine whether or not there are any topics that are unread.
Correctness check: the link should appear if and only if the forum icon on forum listing shows unread topics exist in the forum.