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
3232 public function beforeSave (CategoryRepository $ subject , CategoryInterface $ category ): array
3333 {
3434 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 );
3940 }
4041 }
4142 return [$ category ];
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<!--
33/**
4- * Copyright © Magento, Inc. All rights reserved.
5- * See COPYING.txt for license details .
4+ * Copyright 2014 Adobe
5+ * All Rights Reserved .
66 */
77-->
88
You can’t perform that action at this time.
0 commit comments