• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

MG 1.1 Recalculate reviews without comments

Triops

Well-known member
#1
I've finally imported my stoneaged PhotoPost into Xenforo Media Gallery - but forgot to configure the "Require comment when rating media or album" before doing so.

When I now recalculate media rating with cache, the calculations take ratings without comments still into account, although "Require comment when rating media or album" is checked now. I would assume, this setting just works for new ratings.

@Chris D What do you suggstest to query on the database, to either remove all ratings without comments or to recalculate without them, please?
 

Chris D

XenForo developer
Staff member
#2
The following query should work, though I have to urge you to please take backups or run it on a test installation first, just in case something goes wrong (which it might, as I haven't tested it fully!):
SQL:
DELETE FROM xengallery_rating
WHERE rating_id IN(
    SELECT * FROM (
        SELECT rating.rating_id
        FROM xengallery_rating AS rating
        LEFT JOIN xengallery_comment as comment ON
            (comment.rating_id = rating.rating_id)
        WHERE comment.rating_id IS NULL
    ) AS na
)
After you have run that you'll likely need to run the rebuild again.