Improved api_get_settings() to work with results from api_get_current_access_url_id() in case of multi-url not enabled

skala
Yannick Warnier 14 years ago
parent 6157d07572
commit 1b5f30fb17
  1. 3
      main/inc/lib/main_api.lib.php

@ -3615,7 +3615,7 @@ function & api_get_settings($cat = null, $ordering = 'list', $access_url = 1, $u
if ($url_changeable == 1) {
$url_changeable_where= " AND access_url_changeable= '1' ";
}
if (empty($access_url)) { $access_url = 1; }
if (empty($access_url) or $access_url == -1) { $access_url = 1; }
$sql = "SELECT id, variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable " .
" FROM $t_cs WHERE access_url = $access_url $url_changeable_where ";
if (!empty($cat)) {
@ -3627,6 +3627,7 @@ function & api_get_settings($cat = null, $ordering = 'list', $access_url = 1, $u
} else {
$sql .= " ORDER BY 1,2 ASC";
}
error_log($sql);
return Database::store_result(Database::query($sql));
}

Loading…
Cancel
Save