Skip to content
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

Search results return a blank screen #68

Open
djs2014 opened this issue Dec 8, 2023 · 0 comments
Open

Search results return a blank screen #68

djs2014 opened this issue Dec 8, 2023 · 0 comments

Comments

@djs2014
Copy link

djs2014 commented Dec 8, 2023

Error log:
PHP Fatal error: Uncaught TypeError: SimpleSearch\SimpleSearch::createExtract(): Argument #1 ($text) must be of type string, null given, called in ../public_html/core/cache/includes/elements/modx/revolution/modsnippet/41.include.cache.php on line 88 and defined in ../core/components/simplesearch/src/SimpleSearch.php:340

Possible no NULL check in createExtact.
public function createExtract($text, $length = 200,$search = '',$ellipsis = '...') -

I could 'fix' this by adding if(!isset($text)) { $text = ''; } before the call in the SimpleSearch snippet.

 // @@ fix Uncaught TypeError: SimpleSearch\\SimpleSearch::createExtract(): Argument #1 ($text) must be of type string, null given,
 if(!isset($text)) { $text = ''; }
            
 $extract = $search->createExtract($text, $extractLength, $extract,$extractEllipsis);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant