Invalid specifier 'redirect_source__path'

Created on 5 December 2024, 5 months ago

Problem/Motivation

Drupal\Core\Entity\Query\QueryException: Invalid specifier 'redirect_source__path' in Drupal\Core\Entity\Query\Sql\Tables->addField() (line 314 of /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

$query = $redirect_storage
        ->getQuery()
        ->accessCheck(TRUE)
        // Redirects are stored without the leading slash :-(.
        ->condition('redirect_source__path', ltrim($path_without_prefix, '/'));
      if (!empty($langcodes)) {
        $query->condition('language', $langcodes, 'IN');
      }
      $results = $query->execute();

Steps to reproduce

Proposed resolution

We can use

$query = $redirect_storage
        ->getQuery()
        ->accessCheck(TRUE)
        // Redirects are stored without the leading slash :-(.
        ->condition('redirect_source.path', ltrim($path_without_prefix, '/'));
      if (!empty($langcodes)) {
        $query->condition('language', $langcodes, 'IN');
      }
      $results = $query->execute();

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India shubhamsprasad

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

Comments & Activities

Production build 0.71.5 2024