For this specific error the problem is likely in these 2 lines
and
But there are a many other places in the code (lines like $c->sortby('rank','ASC');) where “rank” is used and may create an SQL error in MySQL 8.
$c->sortby('rank','ASC');