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

RequiredFields includes part of locale code in error message #216

Open
robbieaverill opened this issue Jul 6, 2016 · 3 comments
Open

RequiredFields includes part of locale code in error message #216

robbieaverill opened this issue Jul 6, 2016 · 3 comments

Comments

@robbieaverill
Copy link
Contributor

Given that I have a Fluent enabled Page like this:

class MyObject extends Page
{
    private static $db = ['MyFieldHere' => 'Varchar'];

    public function getCMSValidator()
    {
        return new RequiredFields(['MyFieldHere']);
    }
}

... when I submit the CMS form, the error message says "enMy Field Here" is required:

Required field included locale prefix

SS: 3.4.0
Fluent: 3.5.0

@tractorcow
Copy link
Collaborator

Oh, that's quite odd. It must be because of the label tag appearing in the message.

I can't see an easy way around this, other than maybe adjusting the tag so that it encodes nicer? Maybe "(en) Block Name" is required would be acceptable?

@robbieaverill
Copy link
Contributor Author

Yeah, it didn't look simple when I had a quick look at it. That suggestion would definitely be an improvement!

@tractorcow
Copy link
Collaborator

The problem is the [en] flag would then have round brackets on it too. This is why it's hard to put custom html into field labels. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants