From ad6f9ba7bd9e33d88610989faecfb6f911a34a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Fri, 16 Nov 2007 09:27:22 +0000 Subject: #190899 by bjaspan: (regression) return the queries performed in drupal_install_schema() and drupal_uninstall_schema(), so module install hooks can report on creation of tables, or failures, as it was in Drupal 5 --- includes/common.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 5fd634aca..14b6402d1 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3087,6 +3087,10 @@ function drupal_get_schema($name = NULL, $rebuild = FALSE) { * * @param $module * The module for which the tables will be created. + * @return + * An array of arrays with the following key/value pairs: + * success: a boolean indicating whether the query succeeded + * query: the SQL query(s) executed, passed through check_plain() */ function drupal_install_schema($module) { $schema = drupal_get_schema_unprocessed($module); @@ -3096,6 +3100,7 @@ function drupal_install_schema($module) { foreach ($schema as $name => $table) { db_create_table($ret, $name, $table); } + return $ret; } /** @@ -3107,6 +3112,10 @@ function drupal_install_schema($module) { * * @param $module * The module for which the tables will be removed. + * @return + * An array of arrays with the following key/value pairs: + * success: a boolean indicating whether the query succeeded + * query: the SQL query(s) executed, passed through check_plain() */ function drupal_uninstall_schema($module) { $schema = drupal_get_schema_unprocessed($module); @@ -3116,6 +3125,7 @@ function drupal_uninstall_schema($module) { foreach ($schema as $table) { db_drop_table($ret, $table['name']); } + return $ret; } /** -- cgit v1.2.3