File tree Expand file tree Collapse file tree 3 files changed +76
-30
lines changed
Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 3 files changed +76
-30
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,6 @@ public function modifyMeta(array $meta)
150
150
$ meta = $ this ->customizeWeightField ($ meta );
151
151
$ meta = $ this ->customizeNewDateRangeField ($ meta );
152
152
$ meta = $ this ->customizeNameListeners ($ meta );
153
- $ meta = $ this ->customizeUrlKeyField ($ meta );
154
153
155
154
return $ meta ;
156
155
}
@@ -400,35 +399,6 @@ protected function customizeNameListeners(array $meta)
400
399
);
401
400
}
402
401
403
- /**
404
- * Customize URL KEY field
405
- *
406
- * @param array $meta
407
- * @return array
408
- * @since 101.0.1
409
- */
410
- protected function customizeUrlKeyField (array $ meta ): array
411
- {
412
- $ switcherConfig = [
413
- 'tooltip ' => [
414
- 'link ' => 'https://docs.magento.com/user-guide/catalog/catalog-urls.html ' ,
415
- 'description ' => __ (
416
- 'The URL key should consist of lowercase characters with hyphens to separate words. '
417
- ),
418
- ],
419
- ];
420
-
421
- $ path = $ this ->arrayManager ->findPath (
422
- ProductAttributeInterface::CODE_SEO_FIELD_URL_KEY ,
423
- $ meta ,
424
- null ,
425
- 'children '
426
- );
427
- $ meta = $ this ->arrayManager ->merge ($ path . static ::META_CONFIG_PATH , $ meta , $ switcherConfig );
428
-
429
- return $ meta ;
430
- }
431
-
432
402
/**
433
403
* The getter function to get the locale currency for real application code
434
404
*
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Catalog \Ui \DataProvider \Product \Form \Modifier ;
9
+
10
+ use Magento \Catalog \Api \Data \ProductAttributeInterface ;
11
+ use Magento \Framework \Stdlib \ArrayManager ;
12
+
13
+ class Seo extends AbstractModifier
14
+ {
15
+ /**
16
+ * @var ArrayManager
17
+ */
18
+ private ArrayManager $ arrayManager ;
19
+
20
+ /**
21
+ * @param ArrayManager $arrayManager
22
+ */
23
+ public function __construct (
24
+ ArrayManager $ arrayManager
25
+ ) {
26
+ $ this ->arrayManager = $ arrayManager ;
27
+ }
28
+
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ public function modifyData (array $ data ): array
33
+ {
34
+ return $ data ;
35
+ }
36
+
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ public function modifyMeta (array $ meta ): array
41
+ {
42
+ $ meta = $ this ->customizeUrlKeyField ($ meta );
43
+
44
+ return $ meta ;
45
+ }
46
+
47
+ /**
48
+ * Customize URL KEY field
49
+ *
50
+ * @param array $meta
51
+ * @return array
52
+ */
53
+ protected function customizeUrlKeyField (array $ meta ): array
54
+ {
55
+ $ urlKeyConfig = [
56
+ 'tooltip ' => [
57
+ 'link ' => 'https://docs.magento.com/user-guide/catalog/catalog-urls.html ' ,
58
+ 'description ' => __ (
59
+ 'The URL key should consist of lowercase characters with hyphens to separate words. '
60
+ ),
61
+ ],
62
+ ];
63
+
64
+ $ path = $ this ->arrayManager ->findPath (
65
+ ProductAttributeInterface::CODE_SEO_FIELD_URL_KEY ,
66
+ $ meta ,
67
+ null ,
68
+ 'children '
69
+ );
70
+ return $ this ->arrayManager ->merge ($ path . static ::META_CONFIG_PATH , $ meta , $ urlKeyConfig );
71
+ }
72
+ }
Original file line number Diff line number Diff line change 162
162
<item name =" class" xsi : type =" string" >Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\LayoutUpdate</item >
163
163
<item name =" sortOrder" xsi : type =" number" >160</item >
164
164
</item >
165
+ <item name =" seo_update" xsi : type =" array" >
166
+ <item name =" class" xsi : type =" string" >Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Seo</item >
167
+ <item name =" sortOrder" xsi : type =" number" >170</item >
168
+ </item >
165
169
</argument >
166
170
</arguments >
167
171
</virtualType >
You can’t perform that action at this time.
0 commit comments