Skip to content

Search results return a blank screen  #68

@djs2014

Description

@djs2014

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions