RowCountException in ViewsDataExportCommands when using rowCount() with unstructured queries in a Drush command

Created on 18 October 2024, 29 days ago

Problem/Motivation

I encountered an error while running a custom Drush command in Drupal. The issue arises when the command attempts to use the rowCount() function on an unstructured query, resulting in the following error message:

[Drupal\Core\Database\RowCountException]  
rowCount() is supported for DELETE, INSERT, or UPDATE statements performed with structured query builders only, since they would not be portable across database engines otherwise. If the query builders are not sufficient, use a prepareStatement() with an $allow_row_count argument set to TRUE, execute() the Statement and get the number of matched rows via rowCount().

Steps to reproduce

Run the drush vde command.

Proposed resolution

Patch proposed.

This solution path was taken from the following issue: "Fatal error using drush command with Drupal 10" in VDE drush add-on module 🐛 Fatal error using drush command with Drupal 10 RTBC .

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇮🇹Italy antonio.lepore Macerata

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

Comments & Activities

Production build 0.71.5 2024