From ed1d937f56e60afd65e92e32d80c90fc8fd85422 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 6 Aug 2012 10:30:10 +0100 Subject: [PATCH] =?UTF-8?q?Issue=20#1493108=20by=20marcingy,=20sun,=20Mike?= =?UTF-8?q?=20Wacker,=20kbasarab,=20Berdir,=20Rok=20=C5=BDlender,=20cosmic?= =?UTF-8?q?dreams,=20alexpott:=20Convert=20logging=20and=20error=20setting?= =?UTF-8?q?s=20to=20configuration=20system.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/modules/system/system.install | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 96c02c38d767..127208570977 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1973,12 +1973,16 @@ function system_update_8013() { /** * Moves system logging settings from variables to config. + * + * @ingroup config_upgrade */ function system_update_8014() { - $error_level = db_query("SELECT value FROM {variable} WHERE name = 'error_level'")->fetchField(); + // Not using update_variables_to_config(), since the only value is + // 'error_level', which needs to be mapped to a new value. $config = config('system.logging'); - // Only do the conversion if we have a value and it is numeric. - if ($error_level && is_numeric($error_level)) { + $error_level = db_query("SELECT value FROM {variable} WHERE name = 'error_level'")->fetchField(); + if ($error_level !== FALSE) { + $error_level = unserialize($error_level); $map = array( '0' => 'hide', '1' => 'some', @@ -1991,7 +1995,7 @@ function system_update_8014() { db_delete('variable')->condition('name', 'error_level')->execute(); } else { - // Update error_level to the default value. + // Set error_level to the default value. $config->set('error_level', 'all'); } $config->save(); -- GitLab