SQL-DATABASE ERROR

Database error in WoltLab Burning Board: Invalid SQL: SELECT bb1_events.*, bb1_groups.chgpermission, bb1_cal_cats.*, bb1_events_ret.* FROM bb1_events LEFT JOIN bb1_users ON (bb1_users.userid = bb1_events.userid) LEFT JOIN bb1_groups ON (bb1_groups.groupid = bb1_events.groupid) LEFT JOIN bb1_events_ret ON (bb1_events.eventid = bb1_events_ret.eventid) LEFT JOIN bb1_cal_cats ON (bb1_events.catid = bb1_cal_cats.catid) WHERE (public='1' AND ((FIND_IN_SET('5',e.permission)>0 OR e.permission='') AND FIND_IN_SET('5',g.chgpermission)>0) OR bb1_events.userid = 0) AND ((ret_enddate>='2017-06-01' OR ret_enddate<=eventdate) AND eventdate<='2017-06-30' AND (MOD(PERIOD_DIFF(DATE_FORMAT(bb1_events.eventdate,'%y%m'),20176),retval)=0 AND retmode='month' OR (MOD(PERIOD_DIFF(DATE_FORMAT(bb1_events.eventdate,'%y%m'),201706),(retval*12))=0 AND retmode='year') OR retmode!='year' AND retmode!='month') OR MONTH(eventdate)='6' AND YEAR(eventdate)='2017' AND bb1_events_ret.retmode IS NULL)
mysql error: Unknown column 'e.permission' in 'where clause'
mysql error number: 1054
Date: 23.06.2017 @ 01:57
Script:
Referer: