File tree 1 file changed +26
-10
lines changed
app/code/Magento/Eav/Model/Entity/Attribute 1 file changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -190,16 +190,7 @@ public function organizeData($data)
190
190
}
191
191
if ($ data ['groups ' ]) {
192
192
foreach ($ data ['groups ' ] as $ group ) {
193
- $ modelGroup = $ this ->_attrGroupFactory ->create ();
194
- $ modelGroup ->setId (
195
- is_numeric ($ group [0 ]) && $ group [0 ] > 0 ? $ group [0 ] : null
196
- )->setAttributeGroupName (
197
- $ group [1 ]
198
- )->setAttributeSetId (
199
- $ this ->getId ()
200
- )->setSortOrder (
201
- $ group [2 ]
202
- );
193
+ $ modelGroup = $ this ->initGroupModel ($ group );
203
194
204
195
if ($ data ['attributes ' ]) {
205
196
foreach ($ data ['attributes ' ] as $ attribute ) {
@@ -253,6 +244,31 @@ public function organizeData($data)
253
244
return $ this ;
254
245
}
255
246
247
+ /**
248
+ * @param array $group
249
+ * @return Group
250
+ */
251
+ private function initGroupModel ($ group )
252
+ {
253
+ $ modelGroup = $ this ->_attrGroupFactory ->create ();
254
+ $ modelGroup ->setId (
255
+ is_numeric ($ group [0 ]) && $ group [0 ] > 0 ? $ group [0 ] : null
256
+ )->setAttributeGroupName (
257
+ $ group [1 ]
258
+ )->setAttributeSetId (
259
+ $ this ->getId ()
260
+ )->setSortOrder (
261
+ $ group [2 ]
262
+ );
263
+ if ($ modelGroup ->getId ()) {
264
+ $ group = $ this ->_attrGroupFactory ->create ()->load ($ modelGroup ->getId ());
265
+ if ($ group ->getId ()) {
266
+ $ modelGroup ->setAttributeGroupCode ($ group ->getAttributeGroupCode ());
267
+ }
268
+ }
269
+ return $ modelGroup ;
270
+ }
271
+
256
272
/**
257
273
* Validate attribute set name
258
274
*
You can’t perform that action at this time.
0 commit comments