-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMWSearch: TypeError from line 107 in "CirrusSearch.php" #3939
Labels
bug
Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error
Comments
kghbln
added
the
bug
Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error
label
Apr 19, 2019
#0 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Search/Search.php(114):
CirrusSearch->__construct(Wikimedia\Rdbms\DatabaseMysqli)
Obviously this must fail due to [0].
My suggestions is to allow `smwgFallbackSearchType` to contain a
callable and keep any dependency for a particular `SearchEngine`
instance out of the SMW namespace so that one can define the instance
in `LocalSettings.php` as in:
$smwgFallbackSearchType = function( $connection ) {
return new \CirrusSearch();
};
The code in `SMW\MediaWiki\Search\Search::getFallbackSearchEngine`
needs some tweaking to make the callable to be usable.
[0] https://github.com/wikimedia/mediawiki-extensions-CirrusSearch/blob/master/includes/CirrusSearch.php#L102-L121
Cheers
…On 4/19/19, Karsten Hoffmeyer ***@***.***> wrote:
### Setup and configuration
- MediaWiki | 1.32.1 (3efaceb)17:46, 11. Apr. 2019
- PHP | 7.2.15-0ubuntu0.18.04.2 (apache2handler)
- MariaDB | 10.1.38-MariaDB-0ubuntu0.18.04.1
- Elasticsearch | 6.5.4
- Semantic MediaWiki | 3.1.0-alpha (a795e69) 17:50, 15. Apr. 2019
- CirrusSearch | 0.2 (3bcae30) 18:19, 18. Apr. 2019
### Issue
If one would like to use CirrusSearch for searching with unstructured
content I have to add the following configuration:
```php
$wgSearchType = 'SMWSearch';
$smwgFallbackSearchType = 'CirrusSearch';
```
However this leads to the following error:
```
[593268e934e3fe5abe2e7caf]
/w/index.php?search=article&title=Sp%C3%A9cial%3ARecherche&go=Seite
TypeError from line 107 of
/../w/extensions/CirrusSearch/includes/CirrusSearch.php: Argument 1 passed
to CirrusSearch::__construct() must be an instance of
CirrusSearch\SearchConfig or null, instance of
Wikimedia\Rdbms\DatabaseMysqli given, called in
/../w/extensions/SemanticMediaWiki/src/MediaWiki/Search/Search.php on line
114
```
### Stack trace
Produces a [stack
trace](https://www.semantic-mediawiki.org/wiki/Help:Identifying_bugs) and/or
outputs:
```
#0 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Search/Search.php(114):
CirrusSearch->__construct(Wikimedia\Rdbms\DatabaseMysqli)
#1 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Search/Search.php(402):
SMW\MediaWiki\Search\Search->getFallbackSearchEngine()
#2 /../w/includes/specials/SpecialSearch.php(311):
SMW\MediaWiki\Search\Search->setFeatureData(string, boolean)
#3 /../w/includes/specials/SpecialSearch.php(190):
SpecialSearch->showResults(string)
#4 /../w/includes/specialpage/SpecialPage.php(569):
SpecialSearch->execute(NULL)
#5 /../w/includes/specialpage/SpecialPageFactory.php(568):
SpecialPage->run(NULL)
#6 /../w/includes/MediaWiki.php(288):
MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#7 /../w/includes/MediaWiki.php(860): MediaWiki->performRequest()
#8 /../w/includes/MediaWiki.php(517): MediaWiki->main()
#9 /../w/index.php(42): MediaWiki->run()
#10 {main}
```
@s7eph4n It would have been really cool to have this working. I just pray
that this can be solved on the side of SMW somehow since I do not have high
hopes for fixes in CirrusSearch.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#3939
|
That's probably the way to go seeing that there is no standardized constructor for SearchEngines. |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error
Setup and configuration
Issue
If one would like to use CirrusSearch for searching with unstructured content I have to add the following configuration:
However this leads to the following error:
See line 107 of /../w/extensions/CirrusSearch/includes/CirrusSearch.php
Stack trace
Produces a stack trace and/or outputs:
@s7eph4n It would have been really cool to have this working. I just pray that this can be solved on the side of SMW somehow since I do not have high hopes for fixes in CirrusSearch.
The text was updated successfully, but these errors were encountered: