From d4bed7007c0fb03940d495474b51a4bd3400c2d2 Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Thu, 5 Jul 2012 09:29:51 -0700 Subject: [PATCH] Issue #1617006 by ben.kyriakou: Add note to drupal_write_record saying not to use it in update functions --- core/includes/schema.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/includes/schema.inc b/core/includes/schema.inc index 6e267a6f4a3..448ce844278 100644 --- a/core/includes/schema.inc +++ b/core/includes/schema.inc @@ -350,6 +350,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 string $table * The name of the table; this must be defined by a hook_schema() * implementation.