The following patch addresses a bug resulting in stale templates showing in articles, but the question around the ( $latest ) variable still needs to be addressed.
https://gerrit.wikimedia.org/r/#/c/259183/1/includes/api/ApiMobileView.php
The following patch addresses a bug resulting in stale templates showing in articles, but the question around the ( $latest ) variable still needs to be addressed.
https://gerrit.wikimedia.org/r/#/c/259183/1/includes/api/ApiMobileView.php
The code in question was introduced for T55378: ApiMobileView::getData: PoolCounter didn't return parser output. That bug is a bit light on details as to the actual issue and the fix.