@@ -26,28 +26,6 @@ class Page extends AbstractMultiBaseType
26
26
]
27
27
];
28
28
29
- /**
30
- * Return the current configuration.
31
- * Overwrites parent method to migrate deprecated options.
32
- *
33
- * @return array
34
- */
35
- public function getConfig ()
36
- {
37
- // migrate autocomplete options 'namespace' and 'postfix' to 'filter'
38
- if (empty ($ this ->config ['autocomplete ' ]['filter ' ])) {
39
- if (!empty ($ this ->config ['autocomplete ' ]['namespace ' ])) {
40
- $ this ->config ['autocomplete ' ]['filter ' ] = $ this ->config ['autocomplete ' ]['namespace ' ];
41
- unset($ this ->config ['autocomplete ' ]['namespace ' ]);
42
- }
43
- if (!empty ($ this ->config ['autocomplete ' ]['postfix ' ])) {
44
- $ this ->config ['autocomplete ' ]['filter ' ] .= '.+? ' . $ this ->config ['autocomplete ' ]['postfix ' ] . '$ ' ;
45
- unset($ this ->config ['autocomplete ' ]['namespace ' ]);
46
- }
47
- }
48
- return $ this ->config ;
49
- }
50
-
51
29
/**
52
30
* Output the stored data
53
31
*
@@ -105,14 +83,6 @@ public function handleAjax()
105
83
106
84
$ filter = $ this ->config ['autocomplete ' ]['filter ' ];
107
85
108
- // try to use deprecated options namespace and postfix as filter
109
- $ namespace = $ this ->config ['autocomplete ' ]['namespace ' ] ?? '' ;
110
- $ postfix = $ this ->config ['autocomplete ' ]['postfix ' ] ?? '' ;
111
- if (!$ filter ) {
112
- $ filter = $ namespace ? $ namespace . ': ' : '' ;
113
- $ filter .= $ postfix ? '.+? ' . $ postfix . '$ ' : '' ;
114
- }
115
-
116
86
// this basically duplicates what we do in ajax_qsearch() but with a filter
117
87
$ result = [];
118
88
$ counter = 0 ;
@@ -283,5 +253,17 @@ protected function mergeConfig($current, &$config)
283
253
$ config [$ key ] = $ value ;
284
254
}
285
255
}
256
+
257
+ // migrate autocomplete options 'namespace' and 'postfix' to 'filter'
258
+ if (empty ($ config ['autocomplete ' ]['filter ' ])) {
259
+ if (!empty ($ config ['autocomplete ' ]['namespace ' ])) {
260
+ $ config ['autocomplete ' ]['filter ' ] = $ config ['autocomplete ' ]['namespace ' ];
261
+ unset($ config ['autocomplete ' ]['namespace ' ]);
262
+ }
263
+ if (!empty ($ config ['autocomplete ' ]['postfix ' ])) {
264
+ $ config ['autocomplete ' ]['filter ' ] .= '.+? ' . $ config ['autocomplete ' ]['postfix ' ] . '$ ' ;
265
+ unset($ config ['autocomplete ' ]['postfix ' ]);
266
+ }
267
+ }
286
268
}
287
269
}
0 commit comments