Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » NextGEN Gallery Upgrade Loop – wp_options Rows Not Created

  • When I install NextGen Gallery on two of my WP installations, I get the following message to upgrade the database. (But I was able to install it fine on some of my other WP sites).

    Upgrade NextGEN Gallery

    The script detect that you upgrade from a older version. Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue. If you would like to downgrade later, please make first a complete backup of your database and the images.

    The upgrade process may take a while, so please be patient.

    Start upgrade now…

    When I try to upgrade and then press Continue, the same message reappears. I am not running multisite on any of my installations.

    It appears that Nextgen Gallery checks to see whether the database version declared in nggallery.php matches the version in the wp_options table. There is a row with the option name ‘ngg_db_version’ where the database version is also listed.

    Here is the code for the function in nggallery.php:

    function check_for_upgrade() {
    // Inform about a database upgrade
    if( get_option( 'ngg_db_version' ) != NGG_DBVERSION ) {
    if ( isset ($_GET['page']) && $_GET['page'] == NGGFOLDER ) return;
    add_action( 'admin_notices', create_function( '','echo \'<div id="message" class="error"><p><strong>' . __('Please update the database of NextGEN Gallery.', 'nggallery') . ' <a href="admin.php?page=nextgen-gallery">' . __('Click here to proceed.', 'nggallery') . '</a>' . '</strong></p></div>\';'
    ) ); }
    return; }

    I noticed that in the installations that worked, Nextgen Gallery created two rows in the wp_options table. One with option name ‘ngg_db_version’ and one with option name ‘ngg_options’. However, these two rows were NOT created in the installations where I get the message to upgrade.

    For some reason those two rows are not being created when I install Nextgen, which seems to be why I get the message to upgrade the database, resulting in an infinite loop.

    However, all three tables were created in all my installations (wp_ngg_album, wp_ngg_gallery, wp_ngg_pictures).

    I tried uninstalling all my plugins on a test installation to see if there were any conflicts, but the problem still happened. I have several theme files loaded but Twenty Eleven is the one that is active.

    I tried repairing the wp_options database in phpMyAdmin in case it might have been corrupted for some reason, but that did not fix the problem with the Nextgen Gallery installation.

    I use a custom database prefix and tried changing it to the default wp_ just in case, but that did not resolve the problem.

    Can anyone help me figure out why this is happening on some of my installations and what to do to fix it?

    Thank you!

  • The topic ‘NextGEN Gallery Upgrade Loop – wp_options Rows Not Created’ is closed to new replies.