Permalink
Browse files

Revert "Add support for 'flash error messages' to the Form Validation…

… Library"

This reverts commit 03f52d2.
  • Loading branch information...
1 parent 03f52d2 commit 74764a6849e0803f78a3b842b0b2a63d97d1009c @jbottigliero committed Apr 12, 2012
Showing with 12 additions and 21 deletions.
  1. +12 −21 system/libraries/Form_validation.php
@@ -90,7 +90,7 @@ public function __construct($rules = array())
* @param string
* @return object
*/
- public function set_rules($field, $label = '', $rules = '', $flash_error_messages = array())
+ public function set_rules($field, $label = '', $rules = '')
{
// No reason to set rules if we have no POST data
// or a validation array has not been specified
@@ -157,14 +157,13 @@ public function set_rules($field, $label = '', $rules = '', $flash_error_message
// Build our master array
$this->_field_data[$field] = array(
- 'field' => $field,
- 'label' => $label,
- 'rules' => $rules,
- 'is_array' => $is_array,
- 'keys' => $indexes,
- 'postdata' => NULL,
- 'error' => '',
- 'flash_error_messages' => $flash_error_messages
+ 'field' => $field,
+ 'label' => $label,
+ 'rules' => $rules,
+ 'is_array' => $is_array,
+ 'keys' => $indexes,
+ 'postdata' => NULL,
+ 'error' => ''
);
return $this;
@@ -528,20 +527,16 @@ protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
// Set the message type
$type = in_array('required', $rules) ? 'required' : 'isset';
- if ( ! isset($this->_error_messages[$type]) && ! isset($row['flash_error_messages'][$type]))
+ if ( ! isset($this->_error_messages[$type]))
{
if (FALSE === ($line = $this->CI->lang->line($type)))
{
$line = 'The field was not set';
}
}
- else if( ! isset($row['flash_error_messages'][$type]))
- {
- $line = $this->_error_messages[$type];
- }
else
{
- $line = $row['flash_error_messages'][$type];
+ $line = $this->_error_messages[$type];
}
// Build the error message
@@ -672,20 +667,16 @@ protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
// Did the rule test negatively? If so, grab the error.
if ($result === FALSE)
{
- if ( ! isset($this->_error_messages[$rule]) && ! isset($row['flash_error_messages'][$rule]))
+ if ( ! isset($this->_error_messages[$rule]))
{
if (FALSE === ($line = $this->CI->lang->line($rule)))
{
$line = 'Unable to access an error message corresponding to your field name.';
}
}
- else if( ! isset($row['flash_error_messages'][$rule]))
- {
- $line = $this->_error_messages[$rule];
- }
else
{
- $line = $row['flash_error_messages'][$rule];
+ $line = $this->_error_messages[$rule];
}
// Is the parameter we are inserting into the error message the name

0 comments on commit 74764a6

Please sign in to comment.