File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,11 @@ class CategoryRepositoryPlugin
32
32
public function beforeSave (CategoryRepository $ subject , CategoryInterface $ category ): array
33
33
{
34
34
foreach (self ::ATTRIBUTES_TO_PROCESS as $ attributeKey ) {
35
- if ($ attribute = $ category ->getCustomAttribute ($ attributeKey )) {
36
- $ attribute ->setValue ($ category ->formatUrlKey (
37
- $ category ->getData ($ attributeKey )
38
- ));
35
+ $ attribute = $ category ->getCustomAttribute ($ attributeKey );
36
+ if ($ attribute !== null ) {
37
+ $ value = $ category ->getData ($ attributeKey );
38
+ $ formattedValue = $ category ->formatUrlKey ($ value );
39
+ $ attribute ->setValue ($ formattedValue );
39
40
}
40
41
}
41
42
return [$ category ];
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
2
<!--
3
3
/**
4
- * Copyright © Magento, Inc. All rights reserved.
5
- * See COPYING.txt for license details .
4
+ * Copyright 2014 Adobe
5
+ * All Rights Reserved .
6
6
*/
7
7
-->
8
8
You can’t perform that action at this time.
0 commit comments