Catch use of unsupported PDO::FETCH_ contants

Created on 16 July 2025, 3 days ago

Problem/Motivation

We upgraded a site from D10 to D11 and some of the database queries broke, because we used deprecated PDO::FETCH_ constants, support for which was (quietly) dropped by Drupal. See [#3487851] for instance.

Steps to reproduce

Successfully use PDO::FETCH_GROUP in ->fetchAll() on D10 and then get Fetch mode 65543 is not supported. Use supported modes only. after you upgrade to D11.

Proposed resolution

Add a rule to the coder sniffs to report the use of PDO:: constants as an error.

Remaining tasks

Draw the rest of the owl.

Feature request
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇦🇺Australia cafuego

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

Comments & Activities

Production build 0.71.5 2024