File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Catalog/Controller/Adminhtml/Product
ConfigurableProduct/view/adminhtml/web/js/variations Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,13 @@ public function execute()
148148 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
149149 $ this ->_objectManager ->get (\Psr \Log \LoggerInterface::class)->critical ($ e );
150150 $ this ->messageManager ->addExceptionMessage ($ e );
151- $ data = $ this ->persistMediaData ($ product , $ data );
151+ $ data = isset ( $ product ) ? $ this ->persistMediaData ($ product , $ data ) : $ data ;
152152 $ this ->getDataPersistor ()->set ('catalog_product ' , $ data );
153153 $ redirectBack = $ productId ? true : 'new ' ;
154154 } catch (\Exception $ e ) {
155155 $ this ->_objectManager ->get (\Psr \Log \LoggerInterface::class)->critical ($ e );
156156 $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
157- $ data = $ this ->persistMediaData ($ product , $ data );
157+ $ data = isset ( $ product ) ? $ this ->persistMediaData ($ product , $ data ) : $ data ;
158158 $ this ->getDataPersistor ()->set ('catalog_product ' , $ data );
159159 $ redirectBack = $ productId ? true : 'new ' ;
160160 }
Original file line number Diff line number Diff line change @@ -407,15 +407,17 @@ define([
407407 * - associated_product_ids_serialized.
408408 */
409409 serializeData : function ( ) {
410- this . source . data [ 'configurable-matrix-serialized' ] =
411- JSON . stringify ( this . source . data [ 'configurable-matrix' ] ) ;
412-
413- delete this . source . data [ 'configurable-matrix' ] ;
414-
415- this . source . data [ 'associated_product_ids_serialized' ] =
416- JSON . stringify ( this . source . data [ 'associated_product_ids' ] ) ;
410+ if ( this . source . data [ 'configurable-matrix' ] ) {
411+ this . source . data [ 'configurable-matrix-serialized' ] =
412+ JSON . stringify ( this . source . data [ 'configurable-matrix' ] ) ;
413+ delete this . source . data [ 'configurable-matrix' ] ;
414+ }
417415
418- delete this . source . data [ 'associated_product_ids' ] ;
416+ if ( this . source . data [ 'associated_product_ids' ] ) {
417+ this . source . data [ 'associated_product_ids_serialized' ] =
418+ JSON . stringify ( this . source . data [ 'associated_product_ids' ] ) ;
419+ delete this . source . data [ 'associated_product_ids' ] ;
420+ }
419421 } ,
420422
421423 /**
You can’t perform that action at this time.
0 commit comments