TypeError: Drupal\drimage\Controller\DrImageController::image(): Argument #4 ($fid) must be of type int, string given

Created on 2 December 2024, 4 months ago

Problem/Motivation

At some point our logs started to get flooded by this specific error:

TypeError: Drupal\drimage\Controller\DrImageController::image(): Argument #4 ($fid) must be of type int, string given in Drupal\drimage\Controller\DrImageController->image() (line 325 of /var/web/vd25407/deploy/releases/20241113132516/web/modules/contrib/drimage/src/Controller/DrImageController.php).

This is the path that generated the error:

/drimage/520/0/package.json.bak/-/png

I don't think this is a path generated by the drimage module, it's probably a bot, but it shouldn't be flooding logs regardless.

Steps to reproduce

Visit the earlier mentioned path on a website with drimage installed.

Proposed resolution

Improve route parameter validation to make sure these kind of errors are not logged.

🐛 Bug report
Status

Active

Version

2.3

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024