From 2a1aa767f751521a0ac4f5fe42886f3b733901bb Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 31 Mar 2010 14:39:13 -0500 Subject: [PATCH] Updating parent_id for the work tool see #894 (changing table name) --- main/install/update-db-1.8.6.2-1.8.7.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/install/update-db-1.8.6.2-1.8.7.inc.php b/main/install/update-db-1.8.6.2-1.8.7.inc.php index ac56f6086f..334d69aa7f 100755 --- a/main/install/update-db-1.8.6.2-1.8.7.inc.php +++ b/main/install/update-db-1.8.6.2-1.8.7.inc.php @@ -353,7 +353,8 @@ if (defined('SYSTEM_INSTALLATION')) { if ($singleDbForm) { $t_student_publication = "$prefix{$row_course['db_name']}_student_publication"; $t_item_property = "$prefix{$row_course['db_name']}_item_property"; - } + } + $sql_insert_user = "SELECT ref, insert_user_id FROM $t_item_property WHERE tool='work'"; $rs_insert_user = Database::query($sql_insert_user); @@ -372,7 +373,7 @@ if (defined('SYSTEM_INSTALLATION')) { } //updating parent_id of the student_publication table - $sql = 'SELECT id, url, parent_id FROM '.$row_course['db_name'].'.student_publication '; + $sql = 'SELECT id, url, parent_id FROM '.$t_student_publication; $result = Database::query($sql); if (Database::num_rows($result) > 0) { $items = api_store_result($result); @@ -404,7 +405,7 @@ if (defined('SYSTEM_INSTALLATION')) { } if ($parent_id != 0 ) { - $sql = 'UPDATE '.$row_course['db_name'].'.student_publication SET parent_id = '.$parent_id.' WHERE id = '.$file['id'].''; + $sql = 'UPDATE '.$t_student_publication.' SET parent_id = '.$parent_id.' WHERE id = '.$file['id'].''; Database::query($sql); } }