Menu

#175 Smart Search in Joomla fails

Fixed
nobody
None
Medium
Joomla
Defect
2023-12-23
2023-12-20
limliga
No

In Joomla (v4.4.1, PHP v8.2.13), running the Smart Search indexing fails with the EmbedChessBoard plugin installed.

This is the error given:

An Error Has Occurred
The following message was returned by the server:
A parse error has occurred while processing the following JSON data:
Unexpected token '<', "<br /> <b>"... is not valid JSON

Response from the latest Ajax request:

<br/><b>Deprecated</b>:  mb_strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in <b>/home/customer/www/MYSITE/public_html/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php</b> on line <b>41</b><br/><br/><b>Deprecated</b>:  preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in <b>/home/customer/www/MYSITE/public_html/plugins/content/embedchessboard/embedchessboard.php</b> on line <b>165</b><br/>{
    "buffer": null,
    "memory": null,
    "error": null,
    "header": "Indexer Running",
    "message": "Your content is being indexed. Do not close this window.",
    "batchSize": 75,
    "batchOffset": 75,
    "totalItems": 885,
    "pluginState": {
        "Categories": {
            "total": 63,
            "offset": 63
        },
        "Contacts": {
            "total": 15,
            "offset": 4
        },
        "Content": {
            "total": 873,
            "offset": 0
        },
        "Newsfeeds": {
            "total": 1,
            "offset": 0
        }
    },
    "startTime": "2023-12-20 08:13:15",
    "endTime": "2023-12-20 08:13:16",
    "start": 0,
    "complete": 0
}

Discussion

  • Paolo Casaschi

    Paolo Casaschi - 2023-12-22

    It seems unrelated to the Smart Search function, rather an issue caused by php 8.x deprecating passing null arguments to some library functions expecting a string.

    I can't test on php 8.x, therefore I published the joomla extension plugin update to 3.06.01, with a fix that hopefully fixes the problem.

    Please let me know if plugin version 3.06.01 solves your issue.

     
  • limliga

    limliga - 2023-12-23

    Hi,
    I can confirm that adding the cast fixes the issue: the PHP warning is gone and the Smart Serach no longer chokes on it.

    i.e., using this line: preg_match_all( $regex, (string) $row->text, $matches );

    I then updated the extension through the update channel, this small issue remains fixed now. THANKS!

     

Log in to post a comment.