• Resolved jestep

    (@jestep)


    When I try to create a new gallery using nextgen, it is trying to add a new gallery to the database using a primary key of zero.

    [09-Jan-2019 16:48:04 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTOwp_ngg_gallery(title,author,extras_post_id,gid,name,slug,path,pageid,previewpic) VALUES ('Test Gallery 3', '1', '61', '0', 'test-gallery-3', 'Test-Gallery-3-1', '/wp-content/gallery/test-gallery-3-1/', '0', '0') made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, M_Ajax->serve_ajax_request, C_Ajax_Controller->index_action, ExtensibleObject->call_method, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, A_NextGen_AddGallery_Ajax->upload_image_action, C_DataMapper_Model->save, C_Gallery_Mapper->save, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_DataMapper_Driver_Base->save, C_Gallery_Mapper->_save_entity, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Gallery_Mapper->_save_entity, Mixin->call_parent, ExtensibleObject->call_method, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, C_CustomTable_DataMapper_Driver_Mixin->_save_entity, C_Gallery_Mapper->_create, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_NextGen_Table_Extras->_create, Mixin->call_parent, ExtensibleObject->call_method, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, C_CustomTable_DataMapper_Driver_Mixin->_create

    Brand new installation, running twenty16. From the debug log, it is explicitly trying to set gid to zero, which should not be happening. NULL would be fine, but zero is going to cause problems. I haven’t dug through the actual code in the plugin, but something isn’t right here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @jestep!

    Could you please share with us this information?
    Go to Gallery > Overview > Site details
    Copy and paste the information you find there

    Please, share with us your current version of NextGen Gallery and WordPress.

    Keep us posted.

    – Gaby, Customer Support Imagely

    Thread Starter jestep

    (@jestep)

    Thanks for the reply. I see the problem now. The database had sql-mode NO_AUTO_VALUE_ON_ZERO turned on.

    Hi @jestep,

    Great. Please keep us updated on your results after disabling it.

    Mihai

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Bug in SQL query when creating galleries’ is closed to new replies.