We've written an addon that extends Showcase to allow fractional ratings. This was mostly straightforward, except for a very minor change we needed to make to NFLJ_Showcase_DataWriter_Item that couldn't be accomplished except by copy-pasting an entire method in our addon. We're hoping you'll adopt this change into Showcase, since it marginally improves extensibility and is arguably better style.
The change: in the first SQL query within NFLJ_Showcase_DataWriter_Item::updateRating, replace SUM(rating) with COALESCE(SUM(rating), 0).
That query currently works fine without the COALESCE because XenForo_DataWriter automatically converts null int/uint values to 0. But since we changed rating to a float, that implicit conversion no longer happens and we'd get exceptions on items with no ratings.
The change: in the first SQL query within NFLJ_Showcase_DataWriter_Item::updateRating, replace SUM(rating) with COALESCE(SUM(rating), 0).
That query currently works fine without the COALESCE because XenForo_DataWriter automatically converts null int/uint values to 0. But since we changed rating to a float, that implicit conversion no longer happens and we'd get exceptions on items with no ratings.
Upvote
0