Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bobosayhello opened this issue Oct 7, 2011 · 7 comments
Closed
Milestone

Comments

@bobosayhello
Copy link

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";
@ericlbarnes
Copy link
Contributor

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
Copy link
Author

I see your point, maybe possible in CI3.

@narfbg
Copy link
Contributor

narfbg commented Oct 25, 2012

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 added a commit that referenced this issue Dec 14, 2012
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.
@narfbg
Copy link
Contributor

narfbg commented Dec 14, 2012

See the above referenced commit.

@narfbg narfbg closed this as completed Dec 14, 2012
@keatliang2005
Copy link

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
Copy link
Contributor

narfbg commented Dec 24, 2012

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

@keatliang2005
Copy link

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 pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013
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 bcit-ci#961.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants