• Resolved celinesegel

    (@celinesegel)


    For the last couple of weeks, we haven’t been able to create new galleries. Upgraded plugin, WP, lastest PHP version and still same issue.
    Looking in the wp-content/debug.log file, I can see that when a gallery is created it’s ID (in the database) is defaulting to zero. Since zero is NULL and the table isn’t allowed to have null values for the gallery id, it is causing the error. I have replaced the plugin with fresh code and it’s still happening.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @celinesegel,

    According to another similar ticket, having your database setup to “NO_AUTO_VALUE_ON_ZERO” might be generating the issue here.
    If possible, contact your system administrator and check with them if that setting is being used and if it is possible to remove it.

    If possible, share with us the name of your hosting provider.
    Please, keep us posted.

    Developer explanation: This mode causes an INSERT statement with a provided ID of zero to be treated as a literal zero (even though auto_increment columns have a minimum value of 1..) and the *default behavior* of mySQL is to treat 0/NULL for auto-increment columns. So… by default INSERT INTO tmp (id, name) VALUES (0, 'foo') will create a row that honors the auto-increment attribute, but with that mode, it will just create one row and then generate errors when attempting to create new rows because you can’t have more than one row with the same ID (in this case, zero).

    Thread Starter celinesegel

    (@celinesegel)

    All is now fixed. Hosting company removed the line from the database config. Now we are able to upload photos and create new galleries
    thank you.

    • This reply was modified 6 years, 1 month ago by celinesegel.
    • This reply was modified 6 years, 1 month ago by celinesegel.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘CANNOT CREATE NEW GALLERIES’ is closed to new replies.