bcit-ci/CodeIgniter · error · BadMethodCallException
Form_validation: set_rules() called without a $rules paramet
Error message
Form_validation: set_rules() called without a $rules parameter
What it means
Error "Form_validation: set_rules() called without a $rules parameter" thrown in bcit-ci/CodeIgniter.
Source
Thrown at system/libraries/Form_validation.php:196
{
continue;
}
// If the field label wasn't passed we use the field name
$label = isset($row['label']) ? $row['label'] : $row['field'];
// Add the custom error message array
$errors = (isset($row['errors']) && is_array($row['errors'])) ? $row['errors'] : array();
// Here we go!
$this->set_rules($row['field'], $label, $row['rules'], $errors);
}
return $this;
}
elseif ( ! isset($rules))
{
throw new BadMethodCallException('Form_validation: set_rules() called without a $rules parameter');
}
// No fields or no rules? Nothing to do...
if ( ! is_string($field) OR $field === '' OR empty($rules))
{
throw new RuntimeException('Form_validation: set_rules() called with an empty $rules parameter');
}
elseif ( ! is_array($rules))
{
// BC: Convert pipe-separated rules string to an array
if ( ! is_string($rules))
{
throw new InvalidArgumentException('Form_validation: set_rules() expect $rules to be string or array; '.gettype($rules).' given');
}
$rules = preg_split('/\|(?![^\[]*\])/', $rules);
}
View on GitHub (pinned to 3658d731ea)
When it happens
Trigger: Thrown at system/libraries/Form_validation.php:196 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of bcit-ci/CodeIgniter@3658d731ea (2026-08-17).
Data as JSON: /api/errors/2ad9a2d3924627a8.
Report an issue: GitHub.