Creating instance of Drupal\Core\Database\Query\Condition is removed in Drupal 10

Created on 27 March 2023, over 1 year ago
Updated 8 December 2023, 7 months ago

Problem/Motivation

In Drupal\name\Plugin\views\filter\Fulltext::op_word() , Condition object is instantiated.

Per Creating an instance of the class Drupal\Core\Database\Query\Condition with the new keyword is deprecated and an API addition with the method Drupal\Core\Database\Query\Query::getConnection() β†’ :
'Creating an instance of this class is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. Use Database::getConnection()->condition() instead.'

Steps to reproduce

Proposed resolution

Replace

    $where = $this->operator == 'word' ? new Condition('OR') : new Condition('AND');

with

$where = $this->connection->condition($this->operator == 'word' ? 'OR' : 'AND');

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024