This repository was archived by the owner on Feb 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +88
-107
lines changed
assets/components/simplesearch
core/components/simplesearch/src Expand file tree Collapse file tree 4 files changed +88
-107
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ description: >-
55 Evolution (minus the ajax). Only searches Resources; does not search dynamic
66 content.
77author : modxcms
8- version : 3.0.0-alpha
8+ version : 3.0.0-beta
99chunks :
1010 - name : SearchForm
1111 file : searchform.chunk.tpl
@@ -289,12 +289,12 @@ snippets:
289289 lexicon : simplesearch:properties
290290systemSettings :
291291 - key : driver_class
292- value : \SimpleSearch\Driver\SimpleSearchDriverBasic
292+ value : ' '
293293 area : Drivers
294294 - key : autosuggest_tv
295295 value : simpleSearchAutoSuggestions
296296 area : Autosuggest
297297build :
298- - scriptsAfter : [resolve.fixsystemsettings.php]
299- - requires :
300- - modx : ' >=3.0.0-alpha'
298+ scriptsAfter : [resolve.fixsystemsettings.php]
299+ requires :
300+ modx : ' >=3.0.0-alpha'
Original file line number Diff line number Diff line change 1-
2-
31<?php
4- /**
5- * @var \Teleport\Transport\Transport $transport
6- * @var array $object
7- * @var array $options
8- */
9-
10- switch ($ options [xPDOTransport::PACKAGE_ACTION ]) {
11- case xPDOTransport::ACTION_UPGRADE :
12- /** @var modX $modx */
13- $ modx =& $ transport ->xpdo ;
142
15- /** @var \MODX\Revolution\modSystemSetting $ss */
16- $ ss = $ modx ->getObject (\MODX \Revolution \modSystemSetting::class, ['key ' => 'simplesearch.driver_class ' ]);
17- if ($ ss && $ ss ->value === 'SimpleSearchDriverBasic ' ) {
18- $ ss ->set ('value ' , '\SimpleSearch\Driver\SimpleSearchDriverBasic ' );
19- $ ss ->save ();
20- }
3+ use MODX \Revolution \modSystemSetting ;
214
22- break ;
5+ /** @var array $options */
6+ if ($ options [xPDOTransport::PACKAGE_ACTION ] === xPDOTransport::ACTION_UPGRADE ) {
7+ /** @var xPDOTransport $transport */
8+ /** @var modSystemSetting $setting */
9+ $ setting = $ transport ->xpdo ->getObject (modSystemSetting::class, ['key ' => 'simplesearch.driver_class ' ]);
10+ if ($ setting && $ setting ->value === 'SimpleSearchDriverBasic ' ) {
11+ $ setting ->set ('value ' , '' );
12+ $ setting ->save ();
13+ }
2314}
2415
2516return true ;
Original file line number Diff line number Diff line change 11<?php
22
3- require_once dirname (dirname (dirname (__DIR__ ))) . '/config.core.php ' ;
3+ /** @var \MODX\Revolution\modX $modx */
4+ require_once dirname (__DIR__ , 3 ) . '/config.core.php ' ;
45require_once MODX_CORE_PATH . 'config/ ' . MODX_CONFIG_KEY . '.inc.php ' ;
56require_once MODX_CONNECTORS_PATH . 'index.php ' ;
67
8+ use SimpleSearch \Processors \Web \AutoSuggestions ;
79use SimpleSearch \SimpleSearch ;
810
911$ webActions = [
10- 'web/autosuggestions '
12+ 'web/autosuggestions ' => AutoSuggestions::class,
1113];
1214
13- if (!empty ($ _REQUEST ['action ' ]) && in_array ($ _REQUEST ['action ' ], $ webActions )) {
15+ if (!empty ($ _REQUEST ['action ' ]) && array_key_exists ($ _REQUEST ['action ' ], $ webActions )) {
1416 define ('MODX_REQP ' , false );
15- }
1617
17- if (in_array ($ _REQUEST ['action ' ], $ webActions , true )) {
1818 if ($ modx ->user ->hasSessionContext ($ modx ->context ->get ('key ' ))) {
1919 $ _SERVER ['HTTP_MODAUTH ' ] = $ _SESSION ["modx. {$ modx ->context ->get ('key ' )}.user.token " ];
2020 } else {
2323 }
2424
2525 $ _REQUEST ['HTTP_MODAUTH ' ] = $ _SERVER ['HTTP_MODAUTH ' ];
26+ $ _REQUEST ['action ' ] = $ webActions [$ _REQUEST ['action ' ]];
2627}
2728
2829$ instance = $ modx ->services ->get ('simplesearch ' );
2930if ($ instance instanceof SimpleSearch) {
3031 $ modx ->request ->handleRequest ([
3132 'processors_path ' => $ instance ->config ['processors_path ' ],
32- 'location ' => ''
33+ 'location ' => '' ,
3334 ]);
3435}
You can’t perform that action at this time.
0 commit comments