function module_weights_system_module_validate in Util 6.3
Same name and namespace in other branches
- 6.2 module_weights.module \module_weights_system_module_validate()
Implements form_validate().
1 string reference to 'module_weights_system_module_validate'
- module_weights_form_alter in ./
module_weights.module - Implements hook_form_alter().
File
- ./
module_weights.module, line 134 - Allows module weights to be viewed and edited.
Code
function module_weights_system_module_validate($form, &$form_state) {
$weights = fetch_module_weights();
foreach ($weights as $name => $weight) {
// Submitted weights must be numeric.
$found = $form_state['values']["w_{$name}"];
// kjh: added isset to work around empty values for hidden modules
if (isset($found) && !is_numeric($found)) {
form_set_error("weights][w_{$name}", t('The !module module weight must be a number (found "@found").', array(
'!module' => $name,
'@found' => $found,
)));
}
}
}