PHP 8.1 - limitBytes() null passed to mb_strcut()

Created on 7 August 2023, over 1 year ago
Updated 30 August 2023, about 1 year ago

Problem/Motivation

Run cron on a site which has files to be extracted, but the file is missing/delete but Drupal thinks its there in the file managed table. For example run a prod database, but don't ssh down all the files.

Deprecated function: mb_strcut(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\search_api_attachments\Plugin\search_api\processor\FilesExtractor->limitBytes() (line 412 of modules/contrib/search_api_attachments/src/Plugin/search_api/processor/FilesExtractor.php).

Deprecated function: mb_strcut(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\search_api_attachments\Plugin\search_api\processor\FilesExtractor->limitBytes() (line 412

Steps to reproduce

Have a site missing files that should be indexed by SOLR
Run cron
See error

Proposed resolution

limitBytes($extracted_text) test that extracted_text is not NULL

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States NicholasS

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

Comments & Activities

Production build 0.71.5 2024