Support » Plugin: Contact Form DB » CF7 and CFDB – not saving submissions

  • Resolved ninjagowoo

    (@ninjagowoo)


    My form submissions are no longer being saved by CFDB after updating. I am running:

    WP: 3.1.3
    CF7: 2.4.5
    CFDB: 1.8.7

    In my PHP error log I am seeing a lot of

    WordPress database error Table ‘[dbnameremitted].wp_CF7DBPlugin_SUBMITS’ doesn’t exist for query INSERT INTO wp_CF7DBPlugin_SUBMITS (`….

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ninjagowoo

    (@ninjagowoo)

    It looks like this issue was caused by a rename of the cfdb plugin database. Somewhere in the upgrade map the database name went from ‘wp_cf7dbplugin_submits’ to ‘wp_CF7DBPlugin_SUBMITS’. Since the plugin upgrade process did not address this, submitted form data was lost cause it was trying to use the wrong database name.

    To address this functionality I had to delete the plugin entirely and re-install a fresh copy to generate a new database.

    Hope this helps someone along the line.

    Plugin Author Michael Simpson

    (@msimpson)

    The plugin always uses ‘wp_CF7DBPlugin_SUBMITS’ with that exact case. It has never been renamed nor does an upgrade change it. I don’t know how your table name would have been converted to lower case.

    Thread Starter ninjagowoo

    (@ninjagowoo)

    Wow that is very odd then. I haven’t a clue myself.

    OK guys. Neither of you are technically in the wrong here but there is an issue.

    At our work we develop on multiple operating systems. One of our developers works on a Windows machine under WAMP, I develop on OSX under MAMP and we deploy all of our apps on to a CentOS server (LAMP).

    Now the issue, which i wasn’t aware of until trying to troubleshoot this problem, is that when you create tables from a php script on a windows machine running WAMP, for some reason, it forces all table names to lower case. I have tested and confirmed this. This means that when you go to dump the database to a unix based system for
    deployment it stays as lower case but the php script is still looking for the upper case characters.

    As windows isn’t case sensitive this isn’t an issue, however all unix based systems are. So, if you never cross over operating systems when you are developing with wordpress (or anything else really) you’ll never have this problem.

    Best thing to do would be to ensure you always develop with this in mind, especially when creating your tables. Very annoying but an unfortunate fact at the moment.

    TL;DR – when creating a wordpress plugin it’s best to name all of your tables in lower case.

    EDIT: This is how we solved our problem. We modified CF7DBPlugin.php…

    FROM:
    Line 615: return $this->prefixTableName('SUBMITS');

    TO:
    Line 615: return strtolower($this->prefixTableName('SUBMITS'));

    This might not work for everyone but it definitely fixes our problem.

    Thread Starter ninjagowoo

    (@ninjagowoo)

    I was suspicious of such a thing… thank you for confirming and providing your fix.

    Plugin Author Michael Simpson

    (@msimpson)

    I plan to make the upgrade the next version (post 1.8.8) changed the table name to all lower case to avoid this problem. Thanks for figuring it out.

    No Problem. I wouldn’t think that a lot of people have this issue but it’s probably a good thing to be aware of regarding operating systems in general.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘CF7 and CFDB – not saving submissions’ is closed to new replies.