Add null safe operator when calling any method on $query

Created on 5 December 2022, almost 2 years ago
Updated 20 May 2023, over 1 year ago

Problem/Motivation

Seems like after the recent update the module throws errors like this while installation:

 Error: Call to a member function preExecute() on null in Drupal\search_api\Plugin\views\cache\SearchApiTimeCache->alterCacheMetadata() (line 293 of modules/contrib/search_api/src/Plugin/views/cache/SearchApiCachePluginTrait.php) 

This occurs because sometimes getSearchApiQuery() can return null.

Steps to reproduce

Install version 8.x-1.28 of the module and and try to enable the module.

Proposed resolution

  1. Identify all the places which could throw error like this
  2. Use null safe operator for function calls in all those places.

Remaining tasks

  1. Create patch
  2. Test patch
๐Ÿ› Bug report
Status

Closed: duplicate

Version

1.28

Component

Views integration

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Shriaas Pune

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024