Upgrade loops infinitely (v. From any version to 2.9 - 2.92)

When upgrading a previous release to 2.92, you see the message "Your system must be upgraded". But the system never completes the upgrade. This happens when the tempinv.php file is being used (for inventory checking as items are added to the cart), and the tempinv table also already exists.

This will be corrected in 2.93. For earlier 2.9 versions, you can open the upgrade.php file in the /includes/ folder of the /storeadmin/ folder, and change:

// TEMP INVENTORY
if (file_exists("../" .SB_GO_DIR ."/tempinv.php"))
{
$v29_upgrade['Create temporary inventory table'] = "CREATE TABLE IF NOT EXISTS " .SB_DB_PREFIX ."_tempinv (ID int(11) NOT NULL auto_increment, TempInvID varchar(12) NOT NULL, ItemID int(11) NOT NULL default 0, OptionID int(11) NOT NULL default 0, TempTime varchar(10) NOT NULL, Quantity decimal(5,2) NOT NULL default '0.00', PRIMARY KEY (ID))";
}

to:

// TEMP INVENTORY
if (file_exists("../" .SB_GO_DIR ."/tempinv.php"))
{
$tempinvnt=$dataconn->query("SELECT ID FROM " . SB_DB_PREFIX . "_tempinv LIMIT 1");
if ($tempinvnt === false)
{
$v29_upgrade['Create temporary inventory table'] = "CREATE TABLE IF NOT EXISTS " .SB_DB_PREFIX ."_tempinv (ID int(11) NOT NULL auto_increment, TempInvID varchar(12) NOT NULL, ItemID int(11) NOT NULL default 0, OptionID int(11) NOT NULL default 0, TempTime varchar(10) NOT NULL, Quantity decimal(5,2) NOT NULL default '0.00', PRIMARY KEY (ID))";
}
}