PDA


View Full Version : Bug: Removing a cutom setting


led_belly
12-07-2005, 09:35 PM
Under 'Default Settings' in the vBa admin I chose 'Add Setting' for an Options box then decided I didn't want it anymore. I chose 'Delete' but it wasn't removed. How can I remove it?

led_belly
12-07-2005, 10:33 PM
As a temp fix I followed the code in the vba_cmsp_admin.php:

$db->query_write("DELETE FROM " . TABLE_PREFIX . "adv_setting WHERE varname = '$varname' AND grouptitle = '$grouptitle'");

$dupecheck = $db->query_first("SELECT varname FROM " . TABLE_PREFIX . "adv_setting WHERE varname = '$varname'");
if (!$dupecheck['varname'])
{
$db->query_write("DELETE FROM " . TABLE_PREFIX . "phrase WHERE varname = 'setting_" . $varname . "_desc'");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "phrase WHERE varname = 'setting_" . $varname . "_title'");
}

And deleted the appropriate entries from the adv_setting and phrase tables. I also noticed that it's stored in the datastore table as serialized data. I didn't want to tamper with that so I left it. I hope leaving it won't screw something up later on...

Tom M
12-07-2005, 10:55 PM
I wound up doing the same thing. As far as I can tell this happens when the name chosen is the same as one that already exists and things get confused along the way. I say this because if a 'duplicate' is created then changing values on one item affects the other item.

led_belly
12-08-2005, 12:19 AM
I checked after your post and duplication doesn't seem to be the issue. I don't have the time to track down this behaviour but I'll keep my eye out...