FOP22.31.28 fails with MySQL 8.0.2 "groups" is a reserved keyord (template creation fails)

Using FOP22.31.28 with MySQL 8.0.2 will fail due the use of the "groups" reserved keyword :-(
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#G
Impact: It is not possible to create any templates from the /admin/
256, SQL Error: UPDATE fop2templates SET groups = '', permissions='all', plugins='', isdefault='0' WHERE id = '1' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups = '', permissions='all', plugins='', isdefault='0' WHERE id = '1'' at line 1 (/var/www/html/fop2/admin/dblib.php, 108

Comments

  • Still a problem on MySQL 8.0.20 although some posts report that groups is no longer a reserved word

  • edited July 2020

    FIX:
    groups
    Wherever you use the keyword groups use the back ticked ` around it.

  • The next problem you'll run into is that the custom field has no default value set, so an insert of a new template will blow up on this. Setting the default value on the custom field wil solve this.

  • edited July 2020

    (delete this comment)

  • edited July 2020

    The custom text field is created as NOT NULL, however for a text field you cant set a default value '', so as a fix, just remove the NOT NULL ?

  • Templates creation, update and delete is working now.
    Attached are the modified files from the /var/www/html/fop2/admin/

    • dbsetup.php (altered the custom field creation, it can't block an insert if its null)
    • functions.php (quotes all usages of groups with a back ticked ` )

    Please see the attached Archive.zip for the patched files

  • Thanks, will add the fixes to the next release!

Sign In or Register to comment.