Home > Item #69
I have made changes to my local CactuShop and then uploaded everything (files and data) to update my live site. However, there seem to be some differences as though certain config settings on the live site are different. This cannot be the case because I uploaded the new data. What's going on?
The config system in CactuShop works as follows: the settings themselves are stored in the tblCactuShop1Config database table. When CactuShop first runs, it checks to see if an application variable for one particular config value exists. If it does not, CactuShop builds a set of application variables from the settings in the tblCactuShop1Config table. These settings then reside in memory and are the 'live' config settings that CactuShop pages use. Think of the tblCactuShop1Config database table as purely a storage medium - it is the live set of application variables that are actually used within CactuShop.
If you update a config setting from the back end of CactuShop, the update page ensures that the entire set of live application variables are reset from those in the database (as well as just updating the database record that was being edited). However, if you make a change to the config settings directly in the database, or upload a new database, the live application variables on the site will not be updated. This is because the store will check and find that config settings do exist, and so will not rebuild the live settings from those new ones in the database.
You can force the config settings to rebuild from any page by passing the querystring "appvar=reset". For example:
default.asp?appvar=reset
If you uploaded a new database or changed config settings and did not use the live back end of the store to do this, you can rebuild the live config settings using the above method.