Error messages in form_validation_lang.php not contained in a namespace #539

Closed
bobosayhello opened this Issue Oct 7, 2011 · 7 comments

4 participants

@bobosayhello

For example, it should be:

$lang['form_validation_min_length']="The %s field must be at least %s characters";

Rather than:

$lang['min_length']="The %s field must be at least %s characters";
@ericbarnes

I agree with you, however I don't think it would be good to change it because it would then break all existing sites when they upgrade.

@bobosayhello

I see your point, maybe possible in CI3.

@narfbg

With CI 3.0 coming soon, we better decide on this one soon.

+1 from me, if it's done with a proper explanation in the upgrade guide.
Although we could put a work-around for it to fallback to the old, non-prefixed entries if no e.g. fv_ prefixed values are found. The work-around should then be removed in CI 3.1+.

Any other opinions?

@narfbg narfbg added a commit that referenced this issue Dec 14, 2012
@narfbg narfbg Fix issue #539
Form validation language line keys were not prefixed. They are
now prefixed with 'form_validation_' in order to avoid collisions.
The old keys will still work if a prefixed match is not found, but
are DEPRECATED and will be removed in the next major version.

Also added upgrade notes and changelog entries for the new error
message format from PR #961.
d4eec9f
@narfbg

See the above referenced commit.

@narfbg narfbg closed this Dec 14, 2012
@keatliang2005

One question, the format tweaks is for the custom callback rule and the field name too

suggest just apply only for callbacks

array(
                'field' => 'fieldname',
                'label' => 'lang:fieldname',     #bit tedious for converting this
                'rules' => 'required|callback__validate_fieldname'  #yes suggest just prefix this ....
);

what do you guys think ?

@narfbg

I can't understand what you're trying to say.

@keatliang2005

what i mean is from
i suggest the label when using language

'label' => 'lang:fieldname'

form_validation_fieldname # it is very much not convenient to name spacing this 

no need to using language key name spacing.
just for the callback function will do.

sorry for my bad english

what i mean is just namspacing the callback language key that's enough,

@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013
@narfbg narfbg Fix issue #539
Form validation language line keys were not prefixed. They are
now prefixed with 'form_validation_' in order to avoid collisions.
The old keys will still work if a prefixed match is not found, but
are DEPRECATED and will be removed in the next major version.

Also added upgrade notes and changelog entries for the new error
message format from PR #961.
0f8a7df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment