Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
viveleroi committed Oct 16, 2012
1 parent bb8f61b commit 4612829
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion system/model/Model.php
Expand Up @@ -1872,7 +1872,7 @@ public function query($query = false){
$file = strpos($back[0]['file'], 'Model.php') ? $back[1]['file'] : $back[0]['file'];
$line = strpos($back[0]['file'], 'Model.php') ? $back[1]['line'] : $back[0]['line'];

error()->raise(2, mysqli_error() . "\nSQL:\n" . $query, $file, $line);
error()->raise(2, mysqli_error($this->_db) . "\nSQL:\n" . $query, $file, $line);

} else {
if(config()->get('log_verbosity') < 3){
Expand Down
9 changes: 4 additions & 5 deletions system/preferences/Preferences.php
Expand Up @@ -130,16 +130,15 @@ public function edit($user_id = NULL){
foreach($edit_prefs as $pref){
$record[$pref] = app()->settings->getConfig($pref, $user_id);
}

// process the form if submitted
if(post()->keyExists('preferences-submit')){
$config = model()->open('config');
foreach($record as $field => $existing_value){
$config = model()->open('config');
foreach($record as $field => $existing_value){
if(post()->keyExists($field)){
$record[$field] = post()->getRaw($field);
$config->query( sprintf('DELETE FROM config WHERE config_key = "%s" AND user_id = "%s"', $field, $user_id) );
$config->insert( array('current_value'=>$record[$field],'config_key'=>$field,'user_id'=>$user_id));
}
sml()->say('Your user preferences have been saved successfully.', true);
}

return new Prefs($record);
Expand Down
3 changes: 2 additions & 1 deletion system/router/Router.php
Expand Up @@ -844,7 +844,8 @@ public function here($path, $type = 'method'){

$here = false;

$r = template()->parseNamespacePath($path, $type);
$u = new Url();
$r = $u->parseNamespacePath($path, $type);
$r['module'] = $r['module'] . ($r['interface'] ? '_' . $r['interface'] : false);
$selected_module = $this->module();

Expand Down
2 changes: 1 addition & 1 deletion system/template/Template.php
Expand Up @@ -797,7 +797,7 @@ public function selectArray(
// If the type is ENUM, we'll get the possible values from
// the database
if($method == "ENUM"){
$my_enums = app()->db->MetaColumns($selectTable, false);
$schema = app()->getDatabaseSchema($selectTable);
foreach($my_enums as $value){
if($value->name == $selectField){
foreach($value->enums as $choice){
Expand Down

0 comments on commit 4612829

Please sign in to comment.