NormalizeTokens issue with php 8.0

Created on 6 July 2023, over 1 year ago
Updated 24 September 2023, about 1 year ago

Problem/Motivation

After switching to PHP 8.0 version and while trying to index data, it throws the following issue with the Normalize tokens function, which causes the website indexing to break.

TypeError. Cannot access offset of type string on string in SearchApiAbstractProcessor->normalize Tokens) (line 297 of /var/www/default/htdocs/httpdocs/sites/all/modules/contrib/search_api/includes/processor.inc).

Steps to reproduce

  1. Switch to PHP 8.0 version
  2. Try to Index node content with tokens
  3. And while indexing it breaks the process of indexing

Proposed resolution

Adding condition to check for if $tokens is array before normalising tokens.

Remaining tasks

N/A

šŸ› Bug report
Status

Fixed

Version

1.28

Component

General code

Created by

šŸ‡®šŸ‡³India hitesh-jain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024