From d6272db16eb2d2b11fd1901c4068170377d2d562 Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Fri, 6 Jul 2012 08:26:14 -0700 Subject: Issue #1617006 by ben.kyriakou: Add note to drupal_write_record docs saying not to use in update functions --- includes/common.inc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index c684d4167..50f20e685 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -6899,6 +6899,10 @@ function drupal_schema_fields_sql($table, $prefix = NULL) { /** * Saves (inserts or updates) a record to the database based upon the schema. * + * Do not use drupal_write_record() within hook_update_N() functions, since the + * database schema cannot be relied upon when a user is running a series of + * updates. Instead, use db_insert() or db_update() to save the record. + * * @param $table * The name of the table; this must be defined by a hook_schema() * implementation. -- cgit v1.2.3