codestar-framework icon indicating copy to clipboard operation
codestar-framework copied to clipboard

Default values are never saved for fieldset type when putting fieldset within fieldset

Open dbjpanda opened this issue 1 year ago • 3 comments

I am facing a strange issue, the default value of the fields that are inside fieldset are never stored in options table until I press save button from fronted.

CSF::createSection($this->prefix, [
            'title'  => 'User Fields',
            'parent' => 'global-tab',
            'icon'   => 'fa fa-cog',
            'fields' => [
                [
                    'id' => 'foo',       
                    'type' => 'foo',
                    'default' => 'Foo'        // This value is saved
                ],
                [
                    'id'            => 'user-fields',
                    'type'          => 'fieldset',
                    'fields'    => [
                        [
                            'id' => 'basic',
                            'type'          => 'fieldset',
                            'title'         => 'Basic Fields',
                            'fields'    => [
                                  [
                                      'id' => 'bar',       
                                      'type' => 'text',
                                       'default' => 'Bar'        // This field is never saved
                                  ]
                             ] 
                        ]
                ]
           ]

dbjpanda avatar Dec 05 '23 11:12 dbjpanda

Did you want use defaults outside fieldset? like this: https://codestarframework.com/documentation/#/fields?id=fieldset its better for me

wpiraniir avatar Dec 17 '23 18:12 wpiraniir

@wpiraniir I am facing issues when I put fieldset inside fieldset.

dbjpanda avatar Dec 21 '23 12:12 dbjpanda

@Codestar Any update on this issue please? This seems to be a major issue to me.

dbjpanda avatar May 07 '24 22:05 dbjpanda