Form Validation Translating Field Names Bug |
In version 3, the language library and form_validation class were changed to prefix validation errors with "form_validation_". If I use my own language file for a filed name (as per the documentation), the language library logs an error that the language line could not be found (with the prefix of "form_validation_" added to it).
On closer inspection the _translate_fieldname function of the form_validation class checks if a translation is needed and then tries to load the language line with "form_validation_" prefixed and without. The later indicating that this is deprecated and not logged as an error if not found. Code: protected function _translate_fieldname($fieldname) My assumption was that I was using my own custom human readable name from my own generated language files. I do not want to change all of my language files to include a prefix of "form_validation_" when they are not always used for that purpose. They are used as a human readable name given to fields or in other views I have created. Is this a bug with the form_validation class as I suspect or an oversight in the documentation? It feels like a bug as the function name suggests it is translating a field name and not a form validation error!
This has been fixed now
https://github.com/bcit-ci/CodeIgniter/c...47c45dc851 |
Welcome Guest, Not a member yet? Register Sign In |