Log table not populated due to sql syntax error

To be completed by the original poster:

CMS Version

3.3.1

Player Type

any player

Player Version

all versions

Issue

upon installing XIBO 3.3.1 we quickly noted that the log file is not being populated by any events. inspecting the code finally pointed us in the right direction. The following files contain the sql ‘insert’ commands which as of mysql 8.0.1 is now using a reserved word (in this case the name ‘function’). Making the following changes on the following files:

./lib/Helper/DatabaseLogHandler.php
./lib/Xmds/Soap.php
./lib/Factory/LogFactory.php

corrected the issue:
Original: $SQL = ‘INSERT INTO log (runNo, logdate, channel, type, page, function, message, userid, displayid) VALUES (:runNo, :logdate, :channel, :type, :page, :function, :message, :userid, :displayid)’;

NEW: $SQL = ‘INSERT INTO log (runNo, logdate, channel, type, page, function, message, userid, displayid) VALUES (:runNo, :logdate, :channel, :type, :page, :function, :message, :userid, :displayid)’;

Not sure where else in the code some these reserved words are being used but it would be ideal to include backticks (`) around all variable to avoid such issues going forward

Hi jrabah, welcome to the community!

Please note that Xibo CMS supports MySQL 5.7 currently Version 8 is not supported, I would suggest using the recommend version for your installation.

Here is a link to our installation guide, which lists all of the prerequisites for your installation.

Many Thanks.

We’ve opened an issue regarding MySQL 8 support and linked back to this topic.

Thanks,
Dan

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.