Merge pull request #2423 from drshawnkwang/drupal_fix-bug-readonlydb

Drupal: Changed db_set_active to use proper database name.
This commit is contained in:
tristanolive 2018-03-29 09:35:43 -04:00 committed by GitHub
commit 756b04b836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -123,7 +123,7 @@ function boincteam_import($boincteam, $nid = NULL) {
*/
function _boincteam_userids($boincteamid, $boincid=TRUE) {
$sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s';
db_set_active('boinc');
db_set_active('boinc_ro');
$dbres = db_query($sql, $boincteamid);
db_set_active('default');
$ids = array();

View File

@ -468,7 +468,7 @@ function boincuser_user_delete($account) {
// Keep entry in drupal boincuser table as record of deletion.
// Delete data in BOINC project user table.
db_set_active('boinc');
db_set_active('boinc_rw');
$qrc3 = db_query("UPDATE {user} SET user.create_time=NULL, user.email_addr=NULL, user.name=NULL, user.authenticator=NULL, user.teamid=NULL, user.cross_project_id=NULL, user.passwd_hash=NULL, user.signature=NULL WHERE user.id=%d", $boincid);
db_set_active('default');
}

View File

@ -442,8 +442,7 @@ function boincuser_views_friends_block_header($context = null) {
*/
function _boincuser_user_name_autocomplete($string) {
$matches = array();
// @todo - use boinc_rw if/when read-only PR is merged
db_set_active('boinc');
db_set_active('boinc_ro');
$result = db_query_range("SELECT id,name FROM {user} WHERE name LIKE '%s%'", $string, 0, 10);
db_set_active('default');
while ($user = db_fetch_object($result)) {