File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,6 +119,22 @@ public function getFieldsets(): array
119119 foreach ($ fields as $ field ) {
120120 $ fieldsetCode = (string )$ field ->getFieldset ();
121121
122+ if (isset ($ fieldDefinitions [$ field ->getCode ()])) {
123+ unset($ fieldDefinitions [$ field ->getCode ()]);
124+ }
125+
126+ if (!empty ($ fieldsetCode ) && array_key_exists ($ fieldsetCode , $ fieldsets )) {
127+ $ fieldsets [$ fieldsetCode ]->addField ($ field );
128+ continue ;
129+ }
130+
131+ $ fieldsets ['base ' ]->addField ($ field );
132+ }
133+
134+ foreach ($ fieldDefinitions as $ fieldDefinition ) {
135+ $ block = $ this ->getBlock ();
136+ $ field = $ this ->fieldFactory ->create ($ block , $ fieldDefinition );
137+
122138 if (!empty ($ fieldsetCode ) && array_key_exists ($ fieldsetCode , $ fieldsets )) {
123139 $ fieldsets [$ fieldsetCode ]->addField ($ field );
124140 continue ;
@@ -142,10 +158,6 @@ public function getFields(): array
142158 (array )$ this ->getBlock ()->getFields (),
143159 );
144160
145- if (empty ($ fields )) {
146- return $ fields ;
147- }
148-
149161 return $ fields ;
150162 }
151163
You can’t perform that action at this time.
0 commit comments