Skip to content

Commit 989b39b

Browse files
author
mcramer
committed
Bugfix: Database Update through remoting api
1 parent 664f54f commit 989b39b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interface/lib/classes/sites_database_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function processDatabaseInsert($form_page) {
7575
public function processDatabaseUpdate($form_page) {
7676
global $app;
7777

78-
$old_record = $app->tform->getDataRecord($form_page->id);
78+
$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . intval($form_page->id));
7979

8080
if($form_page->dataRecord["parent_domain_id"] > 0) {
8181
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".intval($form_page->dataRecord["parent_domain_id"]));
@@ -146,7 +146,7 @@ public function processDatabaseUpdate($form_page) {
146146
public function processDatabaseDelete($primary_id) {
147147
global $app;
148148

149-
$old_record = $app->tform->getDataRecord($primary_id);
149+
$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . intval($primary_id));
150150
if($old_record['database_user_id']) {
151151
// check if any database on the server still uses this one
152152
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . intval($old_record['server_id']) . "' AND (`database_user_id` = '" . intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . intval($old_record['database_user_id']) . "') AND `sys_groupid` = '" . intval($old_record['sys_groupid']) . "' AND `database_id` != '" . intval($primary_id) . "'");

0 commit comments

Comments
 (0)