Install script should fail if database tables are not created
-
I had trouble getting Events Manager to work.
I kept getting the error:
Your event details are incorrect and cannot be published, please correct these errors first: Something went wrong saving your event to the index table. Please inform a site administrator about this
I completely removed EM, deleted all database rows containing “dbem_%”, and reinstalled. Still no joy.
Troubleshooting another issue, I happened to read the database error_log, which said that MySQL could not find the correct tables.
Some time ago, I had hardened the site using the instructions here. However, the install script for the plugin requires the database user to have “Create” privileges, so it was never creating the required tables.
I recommend that the install script for this and all other plugins fail with appropriate message if either: (1) the database user has insufficient privileges, or (2) the required tables are not created. It should only take two or three lines of code (perhaps in a couple of places) to check for required privileges or tables and exit if not found. (If you really wanted to get super security cool, you could even prompt to add the privileges before install and then remove them after.)
That is all.
Happy Trails.
- The topic ‘Install script should fail if database tables are not created’ is closed to new replies.