[eluser]pgee70[/eluser]
hi. using code igniter 2.1.2
i have found a bug in the way code igniter renders the validation feedback for the required type.
i was getting a validation message of "The Address 1 field is The %s field is required.."
so i have looked into it. the file:
/system/language/english/form_validation_lang.php
has the entry:
$lang['required'] = "The %s field is required.";
what i think is happening is when the /system/libraries/Form_validation.php _execute runs it must be somehow substituting the 'required' parameter with its key value.
i can't work out where this is happening, but simply changing the word 'required' to 'Required' in language entry 'The %s field is required' fixes the problem.
its got something to do with line 525 of form_validation.php
$message = sprintf($line, $this->_translate_fieldname($row['label']));
where $line = "The %s field is required"
$this->_translate_fieldname($row['label']) = 'Address 1'
its as if it is being called twice and 'required' is being translated to its language entry.
anyway, its late and i can't work it out. so hopefully someone else can work it out.