Form Validation Translating Field Names Bug - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: Form Validation Translating Field Names Bug (/showthread.php?tid=61405) |
Form Validation Translating Field Names Bug - splodgeco - 04-13-2015 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! RE: Form Validation Translating Field Names Bug - splodgeco - 04-14-2015 This has been fixed now https://github.com/bcit-ci/CodeIgniter/commit/5d8e2a6e4c50b772f4b789ea5d831f47c45dc851 RE: Form Validation Translating Field Names Bug - alkarim - 04-16-2015 thanx for reporting about the bug in the forum. |