Skip to content

Commit

Permalink
config class add function now deletes first before adding
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed Nov 15, 2016
1 parent 524d9e5 commit 92793c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/classes/config.class.php
Expand Up @@ -502,6 +502,10 @@ public function add($param_name, $default_value, $type, $subgroup, $fieldset = n
$Qargs[9] = $tab;
}
$Qargs = array_map('DB_escapeString', $Qargs);

// Delete old config value if exists (incase re-adding it for developer db update script)
$sql = "DELETE FROM {$_TABLES['conf_values']} WHERE name = '{$Qargs[0]}' AND group_name = '{$Qargs[4]}' AND subgroup={$Qargs[3]}";
$this->_DB_escapedQuery($sql);

// Now add in config item
$sql = "INSERT INTO {$_TABLES['conf_values']} ($columns) VALUES ("
Expand Down

0 comments on commit 92793c8

Please sign in to comment.