diff --git a/core/includes/image.inc b/core/includes/image.inc index ccc36a4..cfa57b1 100644 --- a/core/includes/image.inc +++ b/core/includes/image.inc @@ -65,7 +65,7 @@ function image_get_toolkit() { if (!isset($toolkit)) { $toolkits = image_get_available_toolkits(); - $toolkit = variable_get('image_toolkit', 'gd'); + $toolkit = config('system.image')->get('toolkit'); if (!isset($toolkits[$toolkit]) || !function_exists('image_' . $toolkit . '_load')) { // The selected toolkit isn't available so return the first one found. If // none are available this will return FALSE. diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 4a4ba0e..380b770 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1837,7 +1837,6 @@ function system_image_toolkit_settings() { $current_toolkit = image_get_toolkit(); if (count($toolkits_available) == 0) { - variable_del('image_toolkit'); $form['image_toolkit_help'] = array( '#markup' => t("No image toolkits were detected. Drupal includes support for PHP's built-in image processing functions but they were not detected on this system. You should consult your system administrator to have them enabled, or try using a third party toolkit.", array('gd-link' => url('http://php.net/gd'))), ); @@ -1848,12 +1847,12 @@ function system_image_toolkit_settings() { $form['image_toolkit'] = array( '#type' => 'radios', '#title' => t('Select an image processing toolkit'), - '#default_value' => variable_get('image_toolkit', $current_toolkit), + '#default_value' => config('system.image')->get('toolkit'), '#options' => $toolkits_available ); } else { - variable_set('image_toolkit', key($toolkits_available)); + config('system.image')->set('toolkit', key($toolkits_available))->save(); } // Get the toolkit's settings form. diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 9d98678..6514f59 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2180,6 +2180,17 @@ function system_update_8050() { } /** + * Moves system image settings from variable to config. + * + * @ingroup config_upgrade + */ +function system_update_8051() { + update_variables_to_config('system.image', array( + 'image_toolkit' => 'current_toolkit', + )); +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */