1010use bantu \IniGetWrapper \IniGetWrapper ;
1111use OC \AppFramework \Http \Request ;
1212use OC \Authentication \Token \IProvider ;
13+ use OC \Core \AppInfo \ConfigLexicon ;
14+ use OC \Core \Application ;
1315use OC \Files \FilenameValidator ;
1416use OC \Search \SearchQuery ;
1517use OC \Template \CSSResourceLocator ;
1820use OCP \App \IAppManager ;
1921use OCP \AppFramework \Http \TemplateResponse ;
2022use OCP \Defaults ;
23+ use OCP \IAppConfig ;
2124use OCP \IConfig ;
2225use OCP \IInitialStateService ;
2326use OCP \INavigationManager ;
@@ -41,6 +44,7 @@ class TemplateLayout extends \OC_Template {
4144 public static $ jsLocator = null ;
4245
4346 private IConfig $ config ;
47+ private IAppConfig $ appConfig ;
4448 private IAppManager $ appManager ;
4549 private InitialStateService $ initialState ;
4650 private INavigationManager $ navigationManager ;
@@ -51,6 +55,7 @@ class TemplateLayout extends \OC_Template {
5155 */
5256 public function __construct ($ renderAs , $ appId = '' ) {
5357 $ this ->config = \OCP \Server::get (IConfig::class);
58+ $ this ->appConfig = \OCP \Server::get (IAppConfig::class);
5459 $ this ->appManager = \OCP \Server::get (IAppManager::class);
5560 $ this ->initialState = \OCP \Server::get (InitialStateService::class);
5661 $ this ->navigationManager = \OCP \Server::get (INavigationManager::class);
@@ -73,9 +78,9 @@ public function __construct($renderAs, $appId = '') {
7378 $ this ->initialState ->provideInitialState ('core ' , 'active-app ' , $ this ->navigationManager ->getActiveEntry ());
7479 $ this ->initialState ->provideInitialState ('core ' , 'apps ' , array_values ($ this ->navigationManager ->getAll ()));
7580
81+ $ this ->initialState ->provideInitialState ('unified-search ' , 'min-search-length ' , $ this ->appConfig ->getValueInt (Application::APP_ID , ConfigLexicon::UNIFIED_SEARCH_MIN_SEARCH_LENGTH ));
7682 if ($ this ->config ->getSystemValueBool ('unified_search.enabled ' , false ) || !$ this ->config ->getSystemValueBool ('enable_non-accessible_features ' , true )) {
7783 $ this ->initialState ->provideInitialState ('unified-search ' , 'limit-default ' , (int )$ this ->config ->getAppValue ('core ' , 'unified-search.limit-default ' , (string )SearchQuery::LIMIT_DEFAULT ));
78- $ this ->initialState ->provideInitialState ('unified-search ' , 'min-search-length ' , (int )$ this ->config ->getAppValue ('core ' , 'unified-search.min-search-length ' , (string )1 ));
7984 $ this ->initialState ->provideInitialState ('unified-search ' , 'live-search ' , $ this ->config ->getAppValue ('core ' , 'unified-search.live-search ' , 'yes ' ) === 'yes ' );
8085 Util::addScript ('core ' , 'legacy-unified-search ' , 'core ' );
8186 } else {
0 commit comments