Welcome Guest, Not a member yet? Register   Sign In
form_validation: rule matches
#1

[eluser]akkumaru[/eluser]
the rule 'matches' syntax:

Code:
matches[form_item];

the logic is fine,
but the produced error message still just states the form_item's 'FIELD NAME', NOT its 'HUMAN NAME',,

i'm not sure if it can be categorized as bug, but i think it would be lovely to have an improvement on this issue,,

thank you
#2

[eluser]xwero[/eluser]
Strange that they haven't added the _translate_fieldname method to the following code
Code:
// Is the parameter we are inserting into the error message the name
                // of another field?  If so we need to grab its "field label"
                if (isset($this->_field_data[$param]) AND isset($this->_field_data[$param]['label']))
                {
                    $param = $this->_field_data[$param]['label'];
                }
So the fix would be
Code:
// Is the parameter we are inserting into the error message the name
                // of another field?  If so we need to grab its "field label"
                if (isset($this->_field_data[$param]) AND isset($this->_field_data[$param]['label']))
                {
                    $param = $this->_translate_fieldname($this->_field_data[$param]['label']);
                }
#3

[eluser]akkumaru[/eluser]
Can i fix the code myself?
if so, where would it be?
#4

[eluser]xwero[/eluser]
The code i showed is located in the _execute method.
#5

[eluser]helmutbjorg[/eluser]
I've hit on the same problem. Can't seem to find the code you are talking about to fix the problem. I have looked through the Form_validation.php file and right through the _execute function. Even searched for parts of the text you posted. But to no avail... What am i missing?
#6

[eluser]xwero[/eluser]
It's in the SVN version of the form validation library, found here, i'm apologize for the mix up.
#7

[eluser]akkumaru[/eluser]
[quote author="xwero" date="1231267908"]It's in the SVN version of the form validation library, found here, i'm apologize for the mix up.[/quote]

ohh,, that's what i thought,,
so i can not fix it myself then,
#8

[eluser]xwero[/eluser]
You can fetch the SVN file and use that, it is as stable or even better than the file from the latest release. And then add the fix.
#9

[eluser]Max Nagaychenko[/eluser]
Thanx!
#10

[eluser]akkumaru[/eluser]
ok! thanks!




Theme © iAndrew 2016 - Forum software by © MyBB