SQL error - column does not exist

Created on 12 July 2024, 4 months ago

Problem/Motivation

Module broken due to a missing column in query

$query = $this->database->select('file_managed', 'f');
$query->condition('f.fid', $currnet_fid, '>');
$query->isNotNull('f.filename');
$query->fields('f', ['fid', 'filename', 'filemime', 'filesize', 'origname']);
$query->where('f.fid NOT IN(SELECT fid from {duplicate_files})');
$query->where('f.fid NOT IN(SELECT original_fid from {duplicate_files})');
$query->range(0, 1);
$row = $query->execute()->fetchObject();

Column not found: 1054 Unknown column 'f.origname' in 'field list': SELECT "f"."fid" AS "fid", "f"."filename" AS "filename", "f"."filemime" AS "filemime", "f"."filesize" AS "filesize", "f"."origname"

That column does not exist in file_managed table

Steps to reproduce

Install and attempt to find duplicates

🐛 Bug report
Status

Needs work

Version

1.2

Component

Code

Created by

🇬🇧United Kingdom masterperoo

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

Comments & Activities

Production build 0.71.5 2024