@@ -274,7 +274,7 @@ public function onUpdatePageLayout()
274
274
275
275
$ object = $ this ->fillObjectFromPost ($ type );
276
276
277
- return $ this ->pushObjectForm ($ type , $ object );
277
+ return $ this ->pushObjectForm ($ type , $ object, Request:: input ( ' formWidgetAlias ' ) );
278
278
}
279
279
280
280
public function onGetInspectorConfiguration ()
@@ -542,7 +542,7 @@ protected function makeObjectFormWidget($type, $object, $alias = null)
542
542
543
543
$ widgetConfig = $ this ->makeConfig ($ formConfigs [$ type ]);
544
544
$ widgetConfig ->model = $ object ;
545
- $ widgetConfig ->alias = $ alias ?: 'form ' . studly_case ($ type ). md5 ($ object ->exists ? $ object ->getFileName () : uniqid ());
545
+ $ widgetConfig ->alias = $ alias ?: 'form ' . studly_case ($ type ) . md5 ($ object ->exists ? $ object ->getFileName () : uniqid ());
546
546
$ widgetConfig ->context = !$ object ->exists ? 'create ' : 'update ' ;
547
547
548
548
$ widget = $ this ->makeWidget ('Backend\Widgets\Form ' , $ widgetConfig );
@@ -693,7 +693,7 @@ protected function fillObjectFromPost($type)
693
693
{
694
694
$ objectPath = trim (Request::input ('objectPath ' ));
695
695
$ object = $ objectPath ? $ this ->loadObject ($ type , $ objectPath ) : $ this ->createObject ($ type );
696
- $ formWidget = $ this ->makeObjectFormWidget ($ type , $ object );
696
+ $ formWidget = $ this ->makeObjectFormWidget ($ type , $ object, Request:: input ( ' formWidgetAlias ' ) );
697
697
698
698
$ saveData = $ formWidget ->getSaveData ();
699
699
$ postData = post ();
@@ -771,9 +771,9 @@ protected function fillObjectFromPost($type)
771
771
return $ object ;
772
772
}
773
773
774
- protected function pushObjectForm ($ type , $ object )
774
+ protected function pushObjectForm ($ type , $ object, $ alias = null )
775
775
{
776
- $ widget = $ this ->makeObjectFormWidget ($ type , $ object );
776
+ $ widget = $ this ->makeObjectFormWidget ($ type , $ object, $ alias );
777
777
778
778
$ this ->vars ['canCommit ' ] = $ this ->canCommitObject ($ object );
779
779
$ this ->vars ['canReset ' ] = $ this ->canResetObject ($ object );
0 commit comments