File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace Backend \FormWidgets ;
44
5+ use ApplicationException ;
56use Backend \Classes \FormWidgetBase ;
67use Backend \Widgets \Form ;
78
@@ -70,7 +71,14 @@ protected function loadAssets()
7071 */
7172 public function getFormFields (): array
7273 {
73- return $ this ->formWidget ->getFields ();
74+ $ fields = $ this ->formWidget ->getFields ();
75+
76+ foreach ($ fields as $ field ) {
77+ if ($ this ->model ->hasRelation ($ field ->fieldName )) {
78+ throw new ApplicationException (trans ('backend::lang.fieldset.relation-not-supported ' ,['field ' => $ field ->fieldName ]));
79+ }
80+ }
81+ return $ fields ;
7482 }
7583
7684 /**
Original file line number Diff line number Diff line change 244244 'column_switch_true ' => 'Yes ' ,
245245 'column_switch_false ' => 'No ' ,
246246 ],
247+ 'fieldset ' => [
248+ 'relation-not-supported ' => ':field: model relation fields are not supported by the fieldset formwidget ' ,
249+ ],
247250 'fileupload ' => [
248251 'attachment ' => 'Attachment ' ,
249252 'help ' => 'Add a title and description for this attachment. ' ,
You can’t perform that action at this time.
0 commit comments