Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.440 diff -u -p -r1.440 system.module --- modules/system/system.module 11 Jan 2007 03:32:56 -0000 1.440 +++ modules/system/system.module 14 Jan 2007 05:16:33 -0000 @@ -747,7 +747,8 @@ function system_image_toolkit_settings() '#type' => 'radios', '#title' => t('Select an image processing toolkit'), '#default_value' => variable_get('image_toolkit', image_get_toolkit()), - '#options' => $toolkits_available + '#options' => $toolkits_available, + '#validate' => array('image_toolkit_validate' => array('image_toolkit', 'image_toolkit')), ); } else { Index: includes/image.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/image.inc,v retrieving revision 1.17 diff -u -p -r1.17 image.inc --- includes/image.inc 26 Dec 2006 14:01:41 -0000 1.17 +++ includes/image.inc 14 Jan 2007 05:16:36 -0000 @@ -44,6 +44,15 @@ function image_get_toolkit() { } /** + * Validates toolkit selection. + */ +function image_toolkit_validate($formelement, $fieldname) { + if ($formelement['#value'] == 'gd' && image_gd_check_settings() == false) { + form_set_error('image_toolkit', t('The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see !url.', array('!url' => l('http://php.net/image', 'http://php.net/image')))); + } +} + +/** * Invokes the given method using the currently selected toolkit. * * @param $method A string containing the method to invoke. @@ -197,8 +206,7 @@ function image_gd_settings() { return $form; } else { - form_set_error('image_toolkit', t('The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see PHP\'s image documentation.', array('@url' => 'http://php.net/image'))); - return FALSE; + return array('#type' => 'item', '#value' => t('The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see !url.', array('!url' => l('http://php.net/image', 'http://php.net/image')))); } }