Where there are several bibliographic records with associated items of different itemtypes then Most popular displays the incorrect itemtype.
Created attachment 69403 [details] All the item types of fiction in this screenshot should be Express fiction & Non-fiction In this Koha instance the item type 'Express fiction & Non-fiction' are set to be hidden by the opachiddenitems syspref. All items in the screenshot of the Most popular section of OPAC except for Fifty fifty are giving a 404 error. That is because Most popular feature is incorrectly displaying hidden items (see bug 19704). All of these items have multiple bibliographic records with associated items with differing itemtypes. For example 'the store' item has 3 bibliographic records with 1 item with the itemtype 'talking book', another item with the item type 'fiction' and another 4 item records with the item type 'Express fiction and non-fiction'. Now the itemtype 'express fiction and non-fiction' is set to be hidden in opachiddenitems syspref. The itemtype for 'The store' in the screenshot is incorrect because it is giving a 404 error when selected (this means it is item type 'express fiction and non-fiction'), however the Most popular feature is displaying an item type of 'fiction'.
The query in Circulation.pm is pulling itemtype from biblioitems, so it looks like the information being displayed is accurate if unexpected. I'm not sure how one reconciles the notion of item-level item types with a limit on item type which groups by biblionumber.
I believe this is the intended behavior right now - showing the itemtype from biblio level. Please re-open if you disagree.