Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to change required fields with an extension


Go to End


3 Posts   1500 Views

Avatar
Optic Blaze

Community Member, 190 Posts

6 June 2016 at 3:15am

Hi there,

I am using an existing module that has the following code:

 
   private static $required_fields = array(
        'Country',
        'State',
        'City',
        'Address',
    );

i am trying to extend the class so that the core module stays the same. I want to change the required fields in the extension to make city and address required. How do i do that?

Avatar
Fred Condo

Community Member, 29 Posts

7 June 2016 at 6:38am

All the private static variables are automatically part of the config system. You can read up on it here: https://docs.silverstripe.org/en/3.3/developer_guides/configuration/configuration/

Avatar
Optic Blaze

Community Member, 190 Posts

8 June 2016 at 4:05am

Thanks...will have a look at it