Message of the day:
SS4.3 is released! - https://www.silverstripe.org/blog/announcing-the-release-of-silverstripe-4-3
Channel purpose:
SilverStripe 4 related information and questions.
Messages:
77473
maybe ->removeRequiredField('FirstName')
? if you don't have access to the validator instance you could do it with injector config, e.g.
Blah\Injector: Blah\Member_Validator: calls: removeFirstName: [ removeRequiredField, [ FirstName ] ]
which would call that whenever injector instantiates a member validator
The customRequired field is allegedly configurable (it's called via $this->config() in actual use, despite being camelCased and neither private, nor static), but FirstName is hardcoded into the variable. Any changes I make via config seem to be additive?
From the example code:
Member_Validator: customRequired: - Surname
The actual variable is this:
'FirstName', 'Email' );
Any ideas on how to remove FirstName from the Member_Validator?
use case being partial translation of a website and indicating if the actual page is available in another defined locale. I set a fallback to English anyway but it would be nice to know before you click on a link...
I'll dig around fluent a bit more, this should be a fairly common use case, I was just surprised that it's not in the docs, at least I haven't found it yet...
Yeah i’d need to see the db sorry, you could do a join
to the above query to filter by what is in UserDefinedForm_Localised_Live
but that is getting tricky. I’d be certain there is a ‘easier’ way via the Fluent API to find what you need. Maybe someone who has used fluent before can help
not extending... was it decorating or so?....
just to bounce some more ideas...it looks it did create something like UserDefinedForm_Localised_Live. So I would probably have to extend SiteTree somehow with the check function so it would be available in all PageTypes...